All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers/ata: correct a wrong free function for sata_nv driver
@ 2007-05-15  6:22 Peer Chen
  2007-05-16  5:21 ` Jeff Garzik
  0 siblings, 1 reply; 11+ messages in thread
From: Peer Chen @ 2007-05-15  6:22 UTC (permalink / raw)
  To: linux-kernel; +Cc: jeff, akpm

For sata_nv driver in kernel 2.6.21 onward, Inside nv_init_one(),use
'hpriv = devm_kzalloc(&pdev->dev, sizeof(*hpriv), GFP_KERNEL);' but
using the kfree(hpriv) to free that data struction in nv_remove_one(),
which will cause system hang when removing the sata_nv module.

Change the 'kfree()' function to 'devm_kfree' will fix this bug.

The patch base on kernel 2.6.22-rc1.

Signed-off-by: Peer Chen <pchen@nvidia.com>
=====================================
--- linux-2.6.22-rc1/drivers/ata/sata_nv.c.orig
+++ linux-2.6.22-rc1/drivers/ata/sata_nv.c
@@ -1619,7 +1619,7 @@ static void nv_remove_one (struct pci_de
 	struct nv_host_priv *hpriv = host->private_data;
 
 	ata_pci_remove_one(pdev);
-	kfree(hpriv);
+	devm_kfree(&pci_dev->dev, hpriv);
 }
 
 #ifdef CONFIG_PM
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-05-18  1:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-15  6:22 [PATCH] drivers/ata: correct a wrong free function for sata_nv driver Peer Chen
2007-05-16  5:21 ` Jeff Garzik
2007-05-16  5:31   ` Peer Chen
2007-05-16  5:31     ` Peer Chen
2007-05-17 11:13     ` [PATCH] sata_nv: fix fallout of devres conversion Tejun Heo
2007-05-18  0:58       ` Jeff Garzik
2007-05-17 10:15   ` [PATCH] drivers/ata: Add the SW NCQ support to sata_nv for MCP51/MCP55/MCP61 Peer Chen
2007-05-17 20:12     ` Andrew Morton
2007-05-17 20:17       ` Andrew Morton
2007-05-17 21:11         ` Jan Engelhardt
2007-05-18  1:47     ` Robert Hancock

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.