pms(4): clear CCBs allocated on the stack

Reviewed By:	imp
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D30300
This commit is contained in:
Edward Tomasz Napierala 2021-05-21 07:28:46 +01:00
parent 95c19e1d65
commit d39aac796b

View File

@ -470,6 +470,7 @@ int agtiapi_getCardInfo ( struct agtiapi_softc *pCard,
void agtiapi_adjust_queue_depth(struct cam_path *path, bit32 QueueDepth) void agtiapi_adjust_queue_depth(struct cam_path *path, bit32 QueueDepth)
{ {
struct ccb_relsim crs; struct ccb_relsim crs;
memset(&crs, 0, sizeof(crs));
xpt_setup_ccb(&crs.ccb_h, path, 5); xpt_setup_ccb(&crs.ccb_h, path, 5);
crs.ccb_h.func_code = XPT_REL_SIMQ; crs.ccb_h.func_code = XPT_REL_SIMQ;
crs.ccb_h.flags = CAM_DEV_QFREEZE; crs.ccb_h.flags = CAM_DEV_QFREEZE;
@ -929,6 +930,7 @@ static int agtiapi_attach( device_t devx )
return( EIO ); return( EIO );
} }
pmsc->path = ccb->ccb_h.path; pmsc->path = ccb->ccb_h.path;
memset(&csa, 0, sizeof(csa));
xpt_setup_ccb(&csa.ccb_h, pmsc->path, 5); xpt_setup_ccb(&csa.ccb_h, pmsc->path, 5);
csa.ccb_h.func_code = XPT_SASYNC_CB; csa.ccb_h.func_code = XPT_SASYNC_CB;
csa.event_enable = AC_FOUND_DEVICE; csa.event_enable = AC_FOUND_DEVICE;
@ -6545,6 +6547,7 @@ int agtiapi_ReleaseHBA( device_t dev )
if (pCard->sim != NULL) if (pCard->sim != NULL)
{ {
mtx_lock(&thisCardInst->pmIOLock); mtx_lock(&thisCardInst->pmIOLock);
memset(&csa, 0, sizeof(csa));
xpt_setup_ccb(&csa.ccb_h, pCard->path, 5); xpt_setup_ccb(&csa.ccb_h, pCard->path, 5);
csa.ccb_h.func_code = XPT_SASYNC_CB; csa.ccb_h.func_code = XPT_SASYNC_CB;
csa.event_enable = 0; csa.event_enable = 0;