Page MenuHomeFreeBSD

g_label_msdosfs.c: remove needless NULL checks before calling g_free()
AcceptedPublic

Authored by danfe on Jun 3 2019, 4:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 9 2024, 5:44 AM
Unknown Object (File)
Jan 1 2024, 8:22 PM
Unknown Object (File)
Dec 28 2023, 4:57 AM
Unknown Object (File)
Nov 18 2023, 2:31 AM
Unknown Object (File)
Nov 18 2023, 1:49 AM
Unknown Object (File)
Oct 24 2023, 9:32 AM
Unknown Object (File)
Oct 12 2023, 12:51 AM
Unknown Object (File)
Sep 29 2023, 10:35 AM
Subscribers

Details

Reviewers
pjd
trasz
imp
Summary

PVS Studio reports: /usr/src/sys/geom/label/g_label_msdosfs.c:207:1: warning: V547 Expression 'sector0 != NULL' is always true.

Indeed, sector0 is being checked for NULL (with early return if it is) on line 75 in this function. However, the proposed patch also removes the check of sector because g_free() calls kernel free() which is documented to do nothing if the argument is NULL.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 24665