aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-scsi.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-02-17 12:24:37 -0500
committerJeff Garzik <jeff@garzik.org>2007-02-21 04:58:17 -0500
commit4d05447ec702364b8a2aebb4d625b16479268575 (patch)
tree1a3ed3c67f9c9ea5229aa3a368809101e9711bc7 /drivers/ata/libata-scsi.c
parent8d9db2d2fbae9e05022825c32f86e00c8e342860 (diff)
libata: fix probe_ent alloc/free bugs
ata_probe_ent_alloc() had a temporary hack such that devm_kzalloc() was used for allocation if devres had been previously initialized on the device; otherwise, plain kzalloc() was used. This was to make the code useable from both the old and devres-aware libata drivers during transition. This hack made ata_sas_port_alloc() unable to determine how the probe_ent is allocated, causing double free in some cases. Remove the now-unneeded hack and make ata_sas_port_alloc() use devm_kfree(). Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: James Bottomley <James.Bottomley@SteelEye.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/libata-scsi.c')
-rw-r--r--drivers/ata/libata-scsi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index d1bf1ca4f717..7bb782b5ce0c 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -3235,7 +3235,7 @@ struct ata_port *ata_sas_port_alloc(struct ata_host *host,
3235 3235
3236 ata_port_init(ap, host, ent, 0); 3236 ata_port_init(ap, host, ent, 0);
3237 ap->lock = shost->host_lock; 3237 ap->lock = shost->host_lock;
3238 kfree(ent); 3238 devm_kfree(host->dev, ent);
3239 return ap; 3239 return ap;
3240} 3240}
3241EXPORT_SYMBOL_GPL(ata_sas_port_alloc); 3241EXPORT_SYMBOL_GPL(ata_sas_port_alloc);