mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
Move a call to cam_freeccb() to avoid a use after free error and
a later double free. Reported by: Coverity CID: 1018507 MFC after: 1 week
This commit is contained in:
parent
090fc1c839
commit
ae092f753a
1 changed files with 1 additions and 1 deletions
|
|
@ -260,7 +260,6 @@ fetch_scsi_capacity(struct cam_device *dev, struct mpt_standalone_disk *disk)
|
|||
cam_freeccb(ccb);
|
||||
return (EIO);
|
||||
}
|
||||
cam_freeccb(ccb);
|
||||
|
||||
/*
|
||||
* A last block of 2^32-1 means that the true capacity is over 2TB,
|
||||
|
|
@ -269,6 +268,7 @@ fetch_scsi_capacity(struct cam_device *dev, struct mpt_standalone_disk *disk)
|
|||
*/
|
||||
if (scsi_4btoul(rcap.addr) != 0xffffffff) {
|
||||
disk->maxlba = scsi_4btoul(rcap.addr);
|
||||
cam_freeccb(ccb);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue