In function ahc_handle_en_lun, variable lstate has not been
freed before return, which can cause memory leak, fix it.

Signed-off-by: Heloise <o...@iscas.ac.cn>
---
 drivers/scsi/aic7xxx/aic7xxx_core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c 
b/drivers/scsi/aic7xxx/aic7xxx_core.c
index 64ab9ea..e8fbdb5 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_core.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_core.c
@@ -7684,6 +7684,7 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim 
*sim, union ccb *ccb)
 
                if (ccb->ccb_h.status != CAM_REQ_CMP) {
                        ahc_unlock(ahc, &s);
+                       kfree(lstate);
                        return;
                }
 
-- 
2.1.0


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to