On 6/19/19 11:26 PM, Ming Lei wrote:
The local variable 'sg' should be initialized in the failure path of
mvumi_make_sgl(), otherwise the following build warning is triggered:
In file included from include/linux/pci-dma-compat.h:8,
from include/linux/pci.h:2408,
from drivers/scsi/mvumi.c:13:
drivers/scsi/mvumi.c: In function 'mvumi_queue_command':
include/linux/dma-mapping.h:608:34: warning: 'sg' may be used
uninitialized in this function
+[-Wmaybe-uninitialized]
#define dma_unmap_sg(d, s, n, r) dma_unmap_sg_attrs(d, s, n, r, 0)
^~~~~~~~~~~~~~~~~~
drivers/scsi/mvumi.c:192:22: note: 'sg' was declared here
struct scatterlist *sg;
^~
Fixed it by removing the local variable reference in failure path.
Reviewed-by: Bart Van Assche <bvanass...@acm.org>