cam: add missing zeroing of a stack-allocated CCB.
This could cause a panic at boot. Reported By: Shawn Webb <shawn.webb AT hardenedbsd.org> Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc.
This commit is contained in:
parent
5365af662c
commit
0f206cc912
@ -2187,6 +2187,7 @@ ata_announce_periph_sbuf(struct cam_periph *periph, struct sbuf *sb)
|
||||
struct ccb_trans_settings cts;
|
||||
u_int speed, mb;
|
||||
|
||||
bzero(&cts, sizeof(cts));
|
||||
_ata_announce_periph(periph, &cts, &speed);
|
||||
if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)
|
||||
return;
|
||||
|
@ -3154,6 +3154,7 @@ scsi_announce_periph(struct cam_periph *periph)
|
||||
struct ccb_trans_settings cts;
|
||||
u_int speed, freq, mb;
|
||||
|
||||
memset(&cts, 0, sizeof(cts));
|
||||
_scsi_announce_periph(periph, &speed, &freq, &cts);
|
||||
if (cam_ccb_status((union ccb *)&cts) != CAM_REQ_CMP)
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user