mirror of
https://git.freebsd.org/src.git
synced 2026-01-11 19:57:22 +00:00
cam: When inq data isn't valid, pass NULL
When the device isn't there, we don't have valid inq data. Pass NULL in this case. All the routines that receive this test against NULL already. Sponsored by: Netflix Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D54470
This commit is contained in:
parent
1a7151f796
commit
aaec2a90b5
1 changed files with 8 additions and 10 deletions
|
|
@ -3711,13 +3711,12 @@ scsi_command_string(struct cam_device *device, struct ccb_scsiio *csio,
|
|||
xpt_gdev_type(cgd, csio->ccb_h.path);
|
||||
|
||||
/*
|
||||
* If the device is unconfigured, just pretend that it is a hard
|
||||
* drive. scsi_op_desc() needs this.
|
||||
* If the device is unconfigured, the inq data is invalid.
|
||||
*/
|
||||
if (cgd->ccb_h.status == CAM_DEV_NOT_THERE)
|
||||
cgd->inq_data.device = T_DIRECT;
|
||||
|
||||
inq_data = &cgd->inq_data;
|
||||
inq_data = NULL;
|
||||
else
|
||||
inq_data = &cgd->inq_data;
|
||||
|
||||
#else /* !_KERNEL */
|
||||
|
||||
|
|
@ -5170,13 +5169,12 @@ scsi_sense_sbuf(struct cam_device *device, struct ccb_scsiio *csio,
|
|||
xpt_gdev_type(cgd, csio->ccb_h.path);
|
||||
|
||||
/*
|
||||
* If the device is unconfigured, just pretend that it is a hard
|
||||
* drive. scsi_op_desc() needs this.
|
||||
* If the device is unconfigured, the inq data is invalid.
|
||||
*/
|
||||
if (cgd->ccb_h.status == CAM_DEV_NOT_THERE)
|
||||
cgd->inq_data.device = T_DIRECT;
|
||||
|
||||
inq_data = &cgd->inq_data;
|
||||
inq_data = NULL;
|
||||
else
|
||||
inq_data = &cgd->inq_data;
|
||||
|
||||
#else /* !_KERNEL */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue