The NULL check on sdp is useless as it has already been de-referenced. sg_fd object without valid parent pointer (sdp) should never occur. Reported-by: Colin Ian King <colin.king@xxxxxxxxxxxxx> Signed-off-by: Douglas Gilbert <dgilbert@xxxxxxxxxxxx> --- drivers/scsi/sg.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 7d4a0fd9ee32..77fec70b7c2f 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -3918,10 +3918,8 @@ sg_remove_sfp_usercontext(struct work_struct *work) o_count, sfp); kfree(sfp); - if (sdp) { - scsi_device_put(sdp->device); - kref_put(&sdp->d_ref, sg_device_destroy); - } + scsi_device_put(sdp->device); + kref_put(&sdp->d_ref, sg_device_destroy); module_put(THIS_MODULE); } -- 2.25.1