HomeFreeBSD

CID 1009492: Logically dead code in sys/cam/scsi/scsi_xpt.c

Description

CID 1009492: Logically dead code in sys/cam/scsi/scsi_xpt.c

In probedone(), for the PROBE_REPORT_LUNS case, all paths that
fall to the bottom of the case set lp to NULL, so the test for a
non-NULL value of lp and call to free() if true is dead code as
the test can never be true. Fix by eliminating the whole if
statement. To guard against a possible future change that accidentally
violates this assumption, use a KASSERT() to catch if lp is
non-NULL.

Reviewed by: cem
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D19109

Details

Committed
dabFeb 11 2019, 10:09 PM
Reviewer
cem
Differential Revision
D19109: CID 1009492: Logically dead code in sys/cam/scsi/scsi_xpt.c
Parents
rS344023: mdmfs: Fix many bugs in automatic md(4) creation.
Branches
Unknown
Tags
Unknown