Fix memory leaks in (a|)daregister introduced in r298002
In the case where cam_iosched_init() fails, the ada and da softcs were leaked. Instead, free them. Reported by: Coverity CID: 1356039 Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
parent
0d0338afc9
commit
75548271a9
@ -1672,6 +1672,7 @@ adaregister(struct cam_periph *periph, void *arg)
|
||||
if (cam_iosched_init(&softc->cam_iosched, periph) != 0) {
|
||||
printf("adaregister: Unable to probe new device. "
|
||||
"Unable to allocate iosched memory\n");
|
||||
free(softc, M_DEVBUF);
|
||||
return(CAM_REQ_CMP_ERR);
|
||||
}
|
||||
|
||||
|
@ -2377,6 +2377,7 @@ daregister(struct cam_periph *periph, void *arg)
|
||||
if (cam_iosched_init(&softc->cam_iosched, periph) != 0) {
|
||||
printf("daregister: Unable to probe new device. "
|
||||
"Unable to allocate iosched memory\n");
|
||||
free(softc, M_DEVBUF);
|
||||
return(CAM_REQ_CMP_ERR);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user