mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
camcontrol powermode: fix use-after-free
Free the ccb after processing the response therein.
Reported by: Coverity
Fixes: 3bed0179ee
MFC after: 1 week
Sponsored by: Dell EMC Isilon
This commit is contained in:
parent
8f391d9098
commit
3bbd1a1a00
1 changed files with 4 additions and 5 deletions
|
|
@ -9312,12 +9312,11 @@ atapm(struct cam_device *device, int argc, char **argv,
|
|||
/*timeout*/timeout ? timeout : 30 * 1000,
|
||||
/*force48bit*/0);
|
||||
|
||||
if (retval == 0 && cmd == ATA_CHECK_POWER_MODE)
|
||||
retval = atapm_proc_resp(device, ccb);
|
||||
|
||||
cam_freeccb(ccb);
|
||||
|
||||
if (retval || cmd != ATA_CHECK_POWER_MODE)
|
||||
return (retval);
|
||||
|
||||
return (atapm_proc_resp(device, ccb));
|
||||
return (retval);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
Loading…
Reference in a new issue