[PATCH] cbus-tahvo-usb: Fix struct tahvo_usb memory leak on exit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The struct tahvo_usb must be free'd on remove.

Signed-off-by: Michael Buesch <mb@xxxxxxxxx>

---

Index: linux-2.6.38-rc7/drivers/cbus/tahvo-usb.c
===================================================================
--- linux-2.6.38-rc7.orig/drivers/cbus/tahvo-usb.c	2011-03-09 18:51:46.240795227 +0100
+++ linux-2.6.38-rc7/drivers/cbus/tahvo-usb.c	2011-03-09 18:52:34.430126706 +0100
@@ -725,6 +725,8 @@ static int __init tahvo_usb_probe(struct
 
 static int __exit tahvo_usb_remove(struct platform_device *pdev)
 {
+	struct tahvo_usb *tu = platform_get_drvdata(pdev);
+
 	dev_dbg(&pdev->dev, "remove\n");
 
 	tahvo_free_irq(TAHVO_INT_VBUSON);
@@ -734,6 +736,8 @@ static int __exit tahvo_usb_remove(struc
 #ifdef CONFIG_USB_OTG
 	device_remove_file(&pdev->dev, &dev_attr_otg_mode);
 #endif
+
+	kfree(tu);
 	tahvo_usb_device = NULL;
 
 	return 0;

-- 
Greetings, Michael.

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux