* [PATCH] tablet: acecad: update the reference count of the usb interface structure
@ 2021-07-24 20:55 Salah Triki
2021-07-27 12:37 ` Dan Carpenter
0 siblings, 1 reply; 4+ messages in thread
From: Salah Triki @ 2021-07-24 20:55 UTC (permalink / raw)
To: Greg Kroah-Hartman, Fabio Aiuto, Ross Schmidt, Marco Cesati,
Brother Matthew De Angelis, Gustavo A. R. Silva, Ivan Safonov
Cc: linux-staging, linux-kernel
Use usb_get_intf() and usb_put_intf() in order to update the reference
count of the usb interface structure.
Signed-off-by: Salah Triki <salah.triki@gmail.com>
---
drivers/input/tablet/acecad.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/input/tablet/acecad.c b/drivers/input/tablet/acecad.c
index a38d1fe97334..85fe134a30ee 100644
--- a/drivers/input/tablet/acecad.c
+++ b/drivers/input/tablet/acecad.c
@@ -151,7 +151,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_
goto fail2;
}
- acecad->intf = intf;
+ acecad->intf = usb_get_intf(intf);
acecad->input = input_dev;
if (dev->manufacturer)
@@ -236,6 +236,9 @@ static void usb_acecad_disconnect(struct usb_interface *intf)
input_unregister_device(acecad->input);
usb_free_urb(acecad->irq);
usb_free_coherent(udev, 8, acecad->data, acecad->data_dma);
+
+ usb_put_intf(acecad->intf);
+
kfree(acecad);
}
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] tablet: acecad: update the reference count of the usb interface structure
2021-07-24 20:55 [PATCH] tablet: acecad: update the reference count of the usb interface structure Salah Triki
@ 2021-07-27 12:37 ` Dan Carpenter
2021-07-29 0:54 ` Salah Triki
0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2021-07-27 12:37 UTC (permalink / raw)
To: Salah Triki
Cc: Greg Kroah-Hartman, Fabio Aiuto, Ross Schmidt, Marco Cesati,
Brother Matthew De Angelis, Gustavo A. R. Silva, Ivan Safonov,
linux-staging, linux-kernel
On Sat, Jul 24, 2021 at 09:55:42PM +0100, Salah Triki wrote:
> Use usb_get_intf() and usb_put_intf() in order to update the reference
> count of the usb interface structure.
>
This commit message doesn't say what the user visible effects are. If
you encountered this bug at runtime then please put the stack trace in
the commit mesage.
Add a Fixes tag.
> Signed-off-by: Salah Triki <salah.triki@gmail.com>
> ---
> drivers/input/tablet/acecad.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/input/tablet/acecad.c b/drivers/input/tablet/acecad.c
> index a38d1fe97334..85fe134a30ee 100644
> --- a/drivers/input/tablet/acecad.c
> +++ b/drivers/input/tablet/acecad.c
> @@ -151,7 +151,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_
> goto fail2;
> }
>
> - acecad->intf = intf;
> + acecad->intf = usb_get_intf(intf);
> acecad->input = input_dev;
>
> if (dev->manufacturer)
You need to call usb_put_intf() if input_register_device() fails.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tablet: acecad: update the reference count of the usb interface structure
2021-07-27 12:37 ` Dan Carpenter
@ 2021-07-29 0:54 ` Salah Triki
2021-07-29 8:31 ` Dan Carpenter
0 siblings, 1 reply; 4+ messages in thread
From: Salah Triki @ 2021-07-29 0:54 UTC (permalink / raw)
To: Dan Carpenter
Cc: Greg Kroah-Hartman, Fabio Aiuto, Ross Schmidt, Marco Cesati,
Brother Matthew De Angelis, Gustavo A. R. Silva, Ivan Safonov,
linux-staging, linux-kernel
On Tue, Jul 27, 2021 at 03:37:56PM +0300, Dan Carpenter wrote:
> This commit message doesn't say what the user visible effects are. If
> you encountered this bug at runtime then please put the stack trace in
> the commit mesage.
>
I made this patch based on the following documentation of
usb_get_intf():
[quote]
Each live reference to a interface must be refcounted.
Drivers for USB interfaces should normally record such references
in their probe methods, when they bind to an interface, and release them
by calling usb_put_intf, in their disconnect methods.
[/quote]
Thanx
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tablet: acecad: update the reference count of the usb interface structure
2021-07-29 0:54 ` Salah Triki
@ 2021-07-29 8:31 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2021-07-29 8:31 UTC (permalink / raw)
To: Salah Triki
Cc: Greg Kroah-Hartman, Fabio Aiuto, Ross Schmidt, Marco Cesati,
Brother Matthew De Angelis, Gustavo A. R. Silva, Ivan Safonov,
linux-staging, linux-kernel
On Thu, Jul 29, 2021 at 01:54:27AM +0100, Salah Triki wrote:
> On Tue, Jul 27, 2021 at 03:37:56PM +0300, Dan Carpenter wrote:
> > This commit message doesn't say what the user visible effects are. If
> > you encountered this bug at runtime then please put the stack trace in
> > the commit mesage.
> >
>
> I made this patch based on the following documentation of
> usb_get_intf():
>
> [quote]
> Each live reference to a interface must be refcounted.
>
> Drivers for USB interfaces should normally record such references
> in their probe methods, when they bind to an interface, and release them
> by calling usb_put_intf, in their disconnect methods.
>
> [/quote]
Put that information in the commit message. Otherwise to review this
patch then I'm trying to look through the syzbot dashboard to find the
stack trace.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-07-29 8:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-24 20:55 [PATCH] tablet: acecad: update the reference count of the usb interface structure Salah Triki
2021-07-27 12:37 ` Dan Carpenter
2021-07-29 0:54 ` Salah Triki
2021-07-29 8:31 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).