]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
CID 1009492: Logically dead code in sys/cam/scsi/scsi_xpt.c
authorDavid Bright <dab@FreeBSD.org>
Mon, 11 Feb 2019 22:09:26 +0000 (22:09 +0000)
committerDavid Bright <dab@FreeBSD.org>
Mon, 11 Feb 2019 22:09:26 +0000 (22:09 +0000)
commit3420c04b44d4568d2eba31feeba2242bf0e87e86
tree8db56a14ce347b295d29bcaa94c2a095f47e050b
parentf95509a489bc55a3aefd0e650509067752a6d279
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
sys/cam/scsi/scsi_xpt.c