input: joystick: pxrc: use usb_get_intf()
Subsystems (3)
PATCH 1/1 input: joystick: pxrc: use usb_get_intf()
Use usb_get_intf() in order to increment reference count of the usb interface structure.
Signed-off-by Salah Triki <[email protected]>
--- drivers/input/joystick/pxrc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/joystick/pxrc.c +1 -1
@@ -143,7 +143,7 @@ static int pxrc_probe(struct usb_interface *intf,return -ENOMEM ;mutex_init (&pxrc->pm_mutex); - pxrc->intf = intf; + pxrc->intf =usb_get_intf (intf);usb_set_intfdata (pxrc->intf, pxrc);
Signature · 1 line
2.25.1
Quoted 14 lines · Salah Triki
Use
usb_get_intf()in order to increment reference count of the usb interface structure.Signed-off-by Salah Triki <[email protected]>--- drivers/input/joystick/pxrc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/input/joystick/pxrc.c +0
-0
drivers/input/joystick/pxrc.c static int pxrc_probe(struct usb_interface *intf, · line 149
Quoted 8 lines
drivers/input/joystick/pxrc.c +1
-1@@ -143,7 +143,7 @@ static int pxrc_probe(struct usb_interface *intf,return -ENOMEM ;mutex_init (&pxrc->pm_mutex); - pxrc->intf = intf; + pxrc->intf =usb_get_intf (intf);usb_set_intfdata (pxrc->intf, pxrc);
You can not add a reference and never drop it :(
Dmitry Torokhov
maintainerQuoted 20 lines · Greg KH
Quoted 19 lines · Salah Triki
Use
usb_get_intf()in order to increment reference count of the usb interface structure.Signed-off-by Salah Triki <[email protected]>--- drivers/input/joystick/pxrc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/input/joystick/pxrc.c +1
-1@@ -143,7 +143,7 @@ static int pxrc_probe(struct usb_interface *intf,return -ENOMEM ;mutex_init (&pxrc->pm_mutex); - pxrc->intf = intf; + pxrc->intf =usb_get_intf (intf);
Quoted 5 lines
drivers/input/joystick/pxrc.c static int pxrc_probe(struct usb_interface *intf, · line 149
Quoted 3 lines
drivers/input/joystick/pxrc.c +0
-0usb_set_intfdata (pxrc->intf, pxrc);You can not add a reference and never drop it :(
On top of that taking a reference here is not useful as the interface must be valid until disconnect() call.
Thanks.
Signature · 1 line
Dmitry