mpt: clear CCBs allocated on the stack

Reviewed By:	imp
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D30302
This commit is contained in:
Edward Tomasz Napierala 2021-05-21 07:58:49 +01:00
parent 7608b98c43
commit de992eed78
2 changed files with 4 additions and 0 deletions

View File

@ -2448,6 +2448,7 @@ mpt_cam_event(struct mpt_softc *mpt, request_t *req,
"XPT_REL_SIMQ");
break;
}
memset(&crs, 0, sizeof(crs));
xpt_setup_ccb(&crs.ccb_h, tmppath, 5);
crs.ccb_h.func_code = XPT_REL_SIMQ;
crs.ccb_h.flags = CAM_DEV_QFREEZE;

View File

@ -296,6 +296,7 @@ mpt_raid_attach(struct mpt_softc *mpt)
goto cleanup;
}
memset(&csa, 0, sizeof(csa));
xpt_setup_ccb(&csa.ccb_h, mpt->path, 5);
csa.ccb_h.func_code = XPT_SASYNC_CB;
csa.event_enable = AC_FOUND_DEVICE;
@ -336,6 +337,7 @@ mpt_raid_detach(struct mpt_softc *mpt)
handler.reply_handler = mpt_raid_reply_handler;
mpt_deregister_handler(mpt, MPT_HANDLER_REPLY, handler,
raid_handler_id);
memset(&csa, 0, sizeof(csa));
xpt_setup_ccb(&csa.ccb_h, mpt->path, /*priority*/5);
csa.ccb_h.func_code = XPT_SASYNC_CB;
csa.event_enable = 0;
@ -1071,6 +1073,7 @@ mpt_adjust_queue_depth(struct mpt_softc *mpt, struct mpt_raid_volume *mpt_vol,
{
struct ccb_relsim crs;
memset(&crs, 0, sizeof(crs));
xpt_setup_ccb(&crs.ccb_h, path, /*priority*/5);
crs.ccb_h.func_code = XPT_REL_SIMQ;
crs.ccb_h.flags = CAM_DEV_QFREEZE;