scsi: scsi_dh_alua: Fix memory leak in alua_rtpg()
authortang.junhui <tang.junhui@zte.com.cn>
Sun, 18 Sep 2016 10:05:11 +0000 (18:05 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 27 Sep 2016 00:42:38 +0000 (20:42 -0400)
buff should be freed before returning with SCSI_DH_RETRY in alua_rtpg().

Signed-off-by: tang.junhui <tang.junhui@zte.com.cn>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/device_handler/scsi_dh_alua.c

index 752b5c9d1ab2779810e68592df10a69eab72b30e..241829e596680f8be89941fc43ce0db642e29b18 100644 (file)
@@ -583,6 +583,7 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg)
                        sdev_printk(KERN_ERR, sdev, "%s: rtpg retry\n",
                                    ALUA_DH_NAME);
                        scsi_print_sense_hdr(sdev, ALUA_DH_NAME, &sense_hdr);
+                       kfree(buff);
                        return err;
                }
                sdev_printk(KERN_ERR, sdev, "%s: rtpg failed\n",