scsi: dpt_i2o: double free on error path
Subsystems (2)
PATCH 1/1 scsi: dpt_i2o: double free on error path
We recently introduced a kfree() in the caller for this function. That's where, logically, you would think the kfree() should be. Unfortunately the code was just ugly and not buggy so the static checker warning was a false postive and introduced a double free.
I've removed the old kfree() and left the new one.
drivers/scsi/dpt_i2o.c +0 -1
@@ -651,7 +651,6 @@ static u32 adpt_ioctl_to_context(adpt_hba * pHba, void *reply) }spin_unlock_irqrestore (pHba->host->host_lock, flags);if (i >= nr) { -kfree (reply);printk (KERN_WARNING "%s: Too many outstanding " "ioctl commands\n" , pHba->name);return (u32)-1 ;
Quoted 5 lines · Dan Carpenter
We recently introduced a
kfree()in the caller for this function. That's where, logically, you would think thekfree()should be. Unfortunately the code was just ugly and not buggy so the static checker warning was a false postive and introduced a double free.
oh, yes! Sorry I missed that.
Quentin
Martin K. Petersen
AppliedQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Dan" = Dan Carpenter <[email protected]> writes:
Dan> We recently introduced a kfree() in the caller for this function. Dan> That's where, logically, you would think the kfree() should be. Dan> Unfortunately the code was just ugly and not buggy so the static Dan> checker warning was a false postive and introduced a double free.
Dan> I've removed the old kfree() and left the new one.
Applied to 4.10/scsi-queue.
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering