Re: [PATCH] scsi: mvumi: fix build warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <bvanassche@xxxxxxx>



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux