lkml.org 
[lkml]   [2012]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] usb-hid-core: Set intfdata to NULL if probe fails
Date
Having a dangling pointer in intfdata is no good, and may actually bite
other drivers which rely on frameworks which only call dev_set_drvdata
on the interface's device if no drvdata has been set (which is how I
found out that usb-hid-core leaves the dangling pointer in there).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/hid/usbhid/hid-core.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 5bf91db..70d760f 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -1296,6 +1296,7 @@ err_free:
kfree(usbhid);
err:
hid_destroy_device(hid);
+ usb_set_intfdata(intf, NULL);
return ret;
}

--
1.7.10


\
 
 \ /
  Last update: 2012-05-21 22:01    [W:0.216 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site