mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-12 09:58:36 +00:00
Redo some code based upon issues found by Coverity.
This commit is contained in:
parent
54302f8e50
commit
8c4e89e249
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=157945
@ -3515,7 +3515,10 @@ isp_control(ispsoftc_t *isp, ispctl_t ctl, void *arg)
|
||||
case ISPCTL_FCLINK_TEST:
|
||||
|
||||
if (IS_FC(isp)) {
|
||||
int usdelay = (arg)? *((int *) arg) : 250000;
|
||||
int usdelay = *((int *) arg);
|
||||
if (usdelay == 0) {
|
||||
usdelay = 250000;
|
||||
}
|
||||
return (isp_fclink_test(isp, usdelay));
|
||||
}
|
||||
break;
|
||||
|
@ -1531,9 +1531,16 @@ isp_handle_platform_atio(ispsoftc_t *isp, at_entry_t *aep)
|
||||
if (tptr == NULL) {
|
||||
tptr = get_lun_statep(isp, bus, CAM_LUN_WILDCARD);
|
||||
if (tptr == NULL) {
|
||||
isp_endcmd(isp, aep,
|
||||
SCSI_STATUS_CHECK_COND | ECMD_SVALID |
|
||||
(0x5 << 12) | (0x25 << 16), 0);
|
||||
/*
|
||||
* Because we can't autofeed sense data back with
|
||||
* a command for parallel SCSI, we can't give back
|
||||
* a CHECK CONDITION. We'll give back a BUSY status
|
||||
* instead. This works out okay because the only
|
||||
* time we should, in fact, get this, is in the
|
||||
* case that somebody configured us without the
|
||||
* blackhole driver, so they get what they deserve.
|
||||
*/
|
||||
isp_endcmd(isp, aep, SCSI_STATUS_BUSY, 0);
|
||||
return (0);
|
||||
}
|
||||
iswildcard = 1;
|
||||
@ -1541,20 +1548,6 @@ isp_handle_platform_atio(ispsoftc_t *isp, at_entry_t *aep)
|
||||
iswildcard = 0;
|
||||
}
|
||||
|
||||
if (tptr == NULL) {
|
||||
/*
|
||||
* Because we can't autofeed sense data back with
|
||||
* a command for parallel SCSI, we can't give back
|
||||
* a CHECK CONDITION. We'll give back a BUSY status
|
||||
* instead. This works out okay because the only
|
||||
* time we should, in fact, get this, is in the
|
||||
* case that somebody configured us without the
|
||||
* blackhole driver, so they get what they deserve.
|
||||
*/
|
||||
isp_endcmd(isp, aep, SCSI_STATUS_BUSY, 0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
atiop = (struct ccb_accept_tio *) SLIST_FIRST(&tptr->atios);
|
||||
if (atiop == NULL) {
|
||||
/*
|
||||
|
@ -203,7 +203,7 @@ isp_fc_runstate(ispsoftc_t *isp, int tval)
|
||||
if (IS_SCSI(isp))
|
||||
return (0);
|
||||
|
||||
tptr = tval? &tval : NULL;
|
||||
tptr = &tval;
|
||||
if (isp_control(isp, ISPCTL_FCLINK_TEST, tptr) != 0) {
|
||||
return (-1);
|
||||
}
|
||||
|
@ -229,7 +229,7 @@ isp_target_notify(ispsoftc_t *isp, void *vptr, uint16_t *optrp)
|
||||
isp_notify_ack(isp, local);
|
||||
break;
|
||||
case IN_RESET:
|
||||
isp_target_async(isp, 0, ASYNC_BUS_RESET);
|
||||
(void) isp_target_async(isp, 0, ASYNC_BUS_RESET);
|
||||
break;
|
||||
case IN_PORT_LOGOUT:
|
||||
case IN_ABORT_TASK:
|
||||
|
Loading…
Reference in New Issue
Block a user