From: Dan Carpenter Date: Wed, 30 Nov 2016 19:36:48 +0000 (+0300) Subject: scsi: dpt_i2o: double free on error path X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=af25756de972d0f05246f9e6869f395ee0302c02;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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. Fixes: 021e2927586d ("scsi: dpt_i2o: Add a missing call to kfree") Signed-off-by: Dan Carpenter Reviewed-by: Quentin Lambert Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index f88b3d216a88..27c0dce22e72 100644 --- a/drivers/scsi/dpt_i2o.c +++ b/drivers/scsi/dpt_i2o.c @@ -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;