summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2016-12-06 17:10:17 +0000
committermav <mav@FreeBSD.org>2016-12-06 17:10:17 +0000
commit930618cc2cb81648a1e52b8ed4c8300cee4599e2 (patch)
tree848945ea588bf61180045e46590ec41eb14ee07b
parent6f147568abe1b1d8948176698418bbd8d9a86bdd (diff)
downloadFreeBSD-src-930618cc2cb81648a1e52b8ed4c8300cee4599e2.zip
FreeBSD-src-930618cc2cb81648a1e52b8ed4c8300cee4599e2.tar.gz
MFC r309282: Explicitly initialize cdai.flags.
In SES driver uninitialized value caused unreliable physpath reporting.
-rw-r--r--sys/cam/cam_xpt.c1
-rw-r--r--sys/cam/scsi/scsi_enc_ses.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index f174671..423e0ad 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -1105,6 +1105,7 @@ xpt_getattr(char *buf, size_t len, const char *attr, struct cam_path *path)
memset(&cdai, 0, sizeof(cdai));
xpt_setup_ccb(&cdai.ccb_h, path, CAM_PRIORITY_NORMAL);
cdai.ccb_h.func_code = XPT_DEV_ADVINFO;
+ cdai.flags = CDAI_FLAG_NONE;
cdai.bufsiz = len;
if (!strcmp(attr, "GEOM::ident"))
diff --git a/sys/cam/scsi/scsi_enc_ses.c b/sys/cam/scsi/scsi_enc_ses.c
index 74753bd..a735a66 100644
--- a/sys/cam/scsi/scsi_enc_ses.c
+++ b/sys/cam/scsi/scsi_enc_ses.c
@@ -1066,6 +1066,7 @@ ses_set_physpath(enc_softc_t *enc, enc_element_t *elm,
*/
xpt_setup_ccb(&cdai.ccb_h, enc->periph->path, CAM_PRIORITY_NORMAL);
cdai.ccb_h.func_code = XPT_DEV_ADVINFO;
+ cdai.flags = CDAI_FLAG_NONE;
cdai.buftype = CDAI_TYPE_SCSI_DEVID;
cdai.bufsiz = CAM_SCSI_DEVID_MAXLEN;
cdai.buf = devid = malloc(cdai.bufsiz, M_SCSIENC, M_WAITOK|M_ZERO);
OpenPOWER on IntegriCloud