summaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2019-05-09 17:22:47 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2019-05-20 16:56:43 +0200
commit41552199b5518fe26bee0829a28dd1880441b430 (patch)
tree4833ff7ee84b433ba835e704d7804940a6113ee2 /drivers/scsi
parentscsi: lpfc: Update lpfc version to 12.2.0.2 (diff)
downloadlinux-41552199b5518fe26bee0829a28dd1880441b430.tar.xz
linux-41552199b5518fe26bee0829a28dd1880441b430.zip
scsi: myrs: Fix uninitialized variable
drivers/scsi/myrs.c: In function 'myrs_log_event': drivers/scsi/myrs.c:821:24: warning: 'sshdr.sense_key' may be used uninitialized in this function [-Wmaybe-uninitialized] struct scsi_sense_hdr sshdr; If ev->ev_code is not 0x1C, sshdr.sense_key may be used uninitialized. Fix this by initializing variable 'sshdr' to 0. Fixes: 77266186397c ("scsi: myrs: Add Mylex RAID controller (SCSI interface)") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/myrs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/myrs.c b/drivers/scsi/myrs.c
index b8d54ef8cf6d..eb0dd566330a 100644
--- a/drivers/scsi/myrs.c
+++ b/drivers/scsi/myrs.c
@@ -818,7 +818,7 @@ static void myrs_log_event(struct myrs_hba *cs, struct myrs_event *ev)
unsigned char ev_type, *ev_msg;
struct Scsi_Host *shost = cs->host;
struct scsi_device *sdev;
- struct scsi_sense_hdr sshdr;
+ struct scsi_sense_hdr sshdr = {0};
unsigned char sense_info[4];
unsigned char cmd_specific[4];