• Christof Schmitt's avatar
    [SCSI] zfcp: Fix warnings from smatch · 22ed1307
    Christof Schmitt authored
    The smatch tool from http://repo.or.cz/w/smatch.git warns about this:
    
    drivers/s390/scsi/zfcp_scsi.c +64 zfcp_scsi_command_fail(5) warn: variable dereferenced before check 'scpnt->device'
    drivers/s390/scsi/zfcp_scsi.c +64 zfcp_scsi_command_fail(5) warn: variable dereferenced before check 'scpnt->device->host'
    drivers/s390/scsi/zfcp_scsi.c +93 zfcp_scsi_queuecommand(23) warn: variable dereferenced before check 'unit'
    
    Fix the first two warnings by removing the checks for scpnt->device
    and -> host: As long as the SCSI command exists, there is also a
    scsi_device and a Scsi_Host.
    
    Fix the last warning by removing the BUG_ON checks in
    zfcp_scsi_queuecommand, they are leftovers from previous paranoia
    about wrong pointers between data structures.
    Reviewed-by: default avatarSwen Schillig <swen@vnet.ibm.com>
    Signed-off-by: default avatarChristof Schmitt <christof.schmitt@de.ibm.com>
    Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
    22ed1307
zfcp_scsi.c 18.8 KB