]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: target: configfs: Delete unnecessary checks for NULL
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 18 Nov 2021 08:49:00 +0000 (11:49 +0300)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 19 Nov 2021 04:07:02 +0000 (23:07 -0500)
commitb8b35ff22c99da9cb1883ce0cdcf8a1f11794932
treeecc518683d599964a793675524ce3252eddbc9d2
parentf43104a753c91ab27f57ed937a1c08d2ec57699a
scsi: target: configfs: Delete unnecessary checks for NULL

The "item" pointer is always going to be valid pointer and does not need to
be checked.

But if "item" were NULL then item_to_lun() would not return a NULL, but
instead, the container_of() pointer math would return a value in the error
pointer range.  This confuses static checkers since it looks like a NULL vs
IS_ERR() bug.

Delete the bogus checks.

Link: https://lore.kernel.org/r/20211118084900.GA24550@kili
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/target/target_core_fabric_configfs.c