linux/drivers/scsi/ibmvscsi
Nathan Chancellor 961ed94e8a scsi: ibmvscsi: Don't use rc uninitialized in ibmvscsi_do_work
clang warns:

drivers/scsi/ibmvscsi/ibmvscsi.c:2126:7: warning: variable 'rc' is used
uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
        case IBMVSCSI_HOST_ACTION_NONE:
             ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/ibmvscsi/ibmvscsi.c:2151:6: note: uninitialized use occurs
here
        if (rc) {
            ^~

Initialize rc in the IBMVSCSI_HOST_ACTION_UNBLOCK case statement then
shuffle IBMVSCSI_HOST_ACTION_NONE down to the default case statement and
make it return early so that rc is never used uninitialized in this
function.

Fixes: 035a3c4046b5 ("scsi: ibmvscsi: redo driver work thread to use enum action states")
Link: https://github.com/ClangBuiltLinux/linux/issues/502
Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
Suggested-by: Tyrel Datwyler <tyreld@linux.ibm.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Acked-by: Tyrel Datwyler <tyreld@linux.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2019-06-18 19:46:24 -04:00
..
ibmvfc.c scsi: ibmvfc: Clean up transport events 2019-03-27 21:34:20 -04:00
ibmvfc.h scsi: ibmvfc: Clean up transport events 2019-03-27 21:34:20 -04:00
ibmvscsi.c scsi: ibmvscsi: Don't use rc uninitialized in ibmvscsi_do_work 2019-06-18 19:46:24 -04:00
ibmvscsi.h scsi: ibmvscsi: fix tripping of blk_mq_run_hw_queue WARN_ON 2019-06-18 19:46:22 -04:00
Makefile ibmvstgt: remove 2014-07-17 22:07:43 +02:00