summaryrefslogtreecommitdiff
path: root/drivers/scsi/libsas/sas_discover.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2011-11-17 17:59:48 -0800
committerJames Bottomley <JBottomley@Parallels.com>2012-02-19 13:39:36 -0600
commit756f173fb5fa90ec15222e80fb579288be7794fd (patch)
tree83633164ff4b8fb20c2fb383429905e25ceed1fc /drivers/scsi/libsas/sas_discover.c
parent735f7d2fedf57380214221be7bed7f62d729e262 (diff)
[SCSI] libsas: fix leak of dev->sata_dev.identify_[packet_]device
These are never freed in the nominal path. A domain_device has a different lifetime than a sas_rphy we need a dev->rphy independent way of identifying sata devices. Reviewed-by: Jack Wang <jack_wang@usish.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/libsas/sas_discover.c')
-rw-r--r--drivers/scsi/libsas/sas_discover.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c
index 4e649306ef4e..dc52b1fa218e 100644
--- a/drivers/scsi/libsas/sas_discover.c
+++ b/drivers/scsi/libsas/sas_discover.c
@@ -30,6 +30,7 @@
#include <scsi/scsi_transport.h>
#include <scsi/scsi_transport_sas.h>
+#include <scsi/sas_ata.h>
#include "../scsi_sas_internal.h"
/* ---------- Basic task processing for discovery purposes ---------- */
@@ -231,6 +232,11 @@ void sas_free_device(struct kref *kref)
if (dev->dev_type == EDGE_DEV || dev->dev_type == FANOUT_DEV)
kfree(dev->ex_dev.ex_phy);
+ if (dev_is_sata(dev)) {
+ kfree(dev->sata_dev.identify_device);
+ kfree(dev->sata_dev.identify_packet_device);
+ }
+
kfree(dev);
}