[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>
This commit is contained in:
Dan Williams
2011-11-17 17:59:48 -08:00
committed by James Bottomley
parent 735f7d2fed
commit 756f173fb5
2 changed files with 8 additions and 1 deletions

View File

@@ -32,7 +32,8 @@
static inline int dev_is_sata(struct domain_device *dev)
{
return (dev->rphy->identify.target_port_protocols & SAS_PROTOCOL_SATA);
return dev->dev_type == SATA_DEV || dev->dev_type == SATA_PM ||
dev->dev_type == SATA_PM_PORT;
}
int sas_ata_init_host_and_port(struct domain_device *found_dev,