* [PATCH] USB: hub: Delete an error message for a failed memory allocation in usb_hub_clear_tt_buffer(
@ 2017-12-06 16:13 SF Markus Elfring
2017-12-06 16:45 ` [PATCH] USB: hub: Delete an error message for a failed memory allocation in usb_hub_clear_tt_buf Alan Stern
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: SF Markus Elfring @ 2017-12-06 16:13 UTC (permalink / raw)
To: linux-usb, Alan Stern, Daniel Drake, Dmitry Fleytman,
Eugene Korenevsky, Geert Uytterhoeven, Greg Kroah-Hartman,
Günter Röck, Johan Hovold, Mathias Nyman, Peter Chen
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 6 Dec 2017 17:00:18 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/usb/core/hub.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 7ccdd3d4db84..9fbb908e9552 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -829,7 +829,6 @@ int usb_hub_clear_tt_buffer(struct urb *urb)
*/
clear = kmalloc(sizeof *clear, GFP_ATOMIC);
if (clear = NULL) {
- dev_err(&udev->dev, "can't save CLEAR_TT_BUFFER state\n");
/* FIXME recover somehow ... RESET_TT? */
return -ENOMEM;
}
--
2.15.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] USB: hub: Delete an error message for a failed memory allocation in usb_hub_clear_tt_buf
2017-12-06 16:13 [PATCH] USB: hub: Delete an error message for a failed memory allocation in usb_hub_clear_tt_buffer( SF Markus Elfring
@ 2017-12-06 16:45 ` Alan Stern
2017-12-06 16:57 ` Greg Kroah-Hartman
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Alan Stern @ 2017-12-06 16:45 UTC (permalink / raw)
To: SF Markus Elfring
Cc: linux-usb, Daniel Drake, Dmitry Fleytman, Eugene Korenevsky,
Geert Uytterhoeven, Greg Kroah-Hartman, Günter Röck,
Johan Hovold, Mathias Nyman, Peter Chen, LKML, kernel-janitors
On Wed, 6 Dec 2017, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 6 Dec 2017 17:00:18 +0100
>
> Omit an extra message for a memory allocation failure in this function.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/usb/core/hub.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> index 7ccdd3d4db84..9fbb908e9552 100644
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -829,7 +829,6 @@ int usb_hub_clear_tt_buffer(struct urb *urb)
> */
> clear = kmalloc(sizeof *clear, GFP_ATOMIC);
> if (clear = NULL) {
> - dev_err(&udev->dev, "can't save CLEAR_TT_BUFFER state\n");
> /* FIXME recover somehow ... RESET_TT? */
> return -ENOMEM;
> }
Does the existing memory allocation error message include the
&udev->dev device name and driver name? If it doesn't, there will be
no way for the user to tell that the error message is related to the
device failure.
Alan Stern
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] USB: hub: Delete an error message for a failed memory allocation in usb_hub_clear_tt_buf
2017-12-06 16:13 [PATCH] USB: hub: Delete an error message for a failed memory allocation in usb_hub_clear_tt_buffer( SF Markus Elfring
2017-12-06 16:45 ` [PATCH] USB: hub: Delete an error message for a failed memory allocation in usb_hub_clear_tt_buf Alan Stern
@ 2017-12-06 16:57 ` Greg Kroah-Hartman
2017-12-06 17:27 ` Geert Uytterhoeven
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2017-12-06 16:57 UTC (permalink / raw)
To: Alan Stern
Cc: SF Markus Elfring, linux-usb, Daniel Drake, Dmitry Fleytman,
Eugene Korenevsky, Geert Uytterhoeven, Günter Röck,
Johan Hovold, Mathias Nyman, Peter Chen, LKML, kernel-janitors
On Wed, Dec 06, 2017 at 11:45:31AM -0500, Alan Stern wrote:
> On Wed, 6 Dec 2017, SF Markus Elfring wrote:
>
> > From: Markus Elfring <elfring@users.sourceforge.net>
> > Date: Wed, 6 Dec 2017 17:00:18 +0100
> >
> > Omit an extra message for a memory allocation failure in this function.
> >
> > This issue was detected by using the Coccinelle software.
> >
> > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> > ---
> > drivers/usb/core/hub.c | 1 -
> > 1 file changed, 1 deletion(-)
> >
> > diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> > index 7ccdd3d4db84..9fbb908e9552 100644
> > --- a/drivers/usb/core/hub.c
> > +++ b/drivers/usb/core/hub.c
> > @@ -829,7 +829,6 @@ int usb_hub_clear_tt_buffer(struct urb *urb)
> > */
> > clear = kmalloc(sizeof *clear, GFP_ATOMIC);
> > if (clear = NULL) {
> > - dev_err(&udev->dev, "can't save CLEAR_TT_BUFFER state\n");
> > /* FIXME recover somehow ... RESET_TT? */
> > return -ENOMEM;
> > }
>
> Does the existing memory allocation error message include the
> &udev->dev device name and driver name? If it doesn't, there will be
> no way for the user to tell that the error message is related to the
> device failure.
Don't worry, I have a filter for this person's emails and do not see
their patches so they will not get applied.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] USB: hub: Delete an error message for a failed memory allocation in usb_hub_clear_tt_buf
2017-12-06 16:13 [PATCH] USB: hub: Delete an error message for a failed memory allocation in usb_hub_clear_tt_buffer( SF Markus Elfring
2017-12-06 16:45 ` [PATCH] USB: hub: Delete an error message for a failed memory allocation in usb_hub_clear_tt_buf Alan Stern
2017-12-06 16:57 ` Greg Kroah-Hartman
@ 2017-12-06 17:27 ` Geert Uytterhoeven
2017-12-06 20:05 ` Joe Perches
2017-12-06 21:18 ` Alan Stern
4 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2017-12-06 17:27 UTC (permalink / raw)
To: Alan Stern
Cc: SF Markus Elfring, USB list, Daniel Drake, Dmitry Fleytman,
Eugene Korenevsky, Greg Kroah-Hartman, Günter Röck,
Johan Hovold, Mathias Nyman, Peter Chen, LKML,
kernel-janitors@vger.kernel.org
Hi Alan,
On Wed, Dec 6, 2017 at 5:45 PM, Alan Stern <stern@rowland.harvard.edu> wrote:
> On Wed, 6 Dec 2017, SF Markus Elfring wrote:
>
>> From: Markus Elfring <elfring@users.sourceforge.net>
>> Date: Wed, 6 Dec 2017 17:00:18 +0100
>>
>> Omit an extra message for a memory allocation failure in this function.
>>
>> This issue was detected by using the Coccinelle software.
>>
>> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
>> ---
>> drivers/usb/core/hub.c | 1 -
>> 1 file changed, 1 deletion(-)
>>
>> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
>> index 7ccdd3d4db84..9fbb908e9552 100644
>> --- a/drivers/usb/core/hub.c
>> +++ b/drivers/usb/core/hub.c
>> @@ -829,7 +829,6 @@ int usb_hub_clear_tt_buffer(struct urb *urb)
>> */
>> clear = kmalloc(sizeof *clear, GFP_ATOMIC);
>> if (clear = NULL) {
>> - dev_err(&udev->dev, "can't save CLEAR_TT_BUFFER state\n");
>> /* FIXME recover somehow ... RESET_TT? */
>> return -ENOMEM;
>> }
>
> Does the existing memory allocation error message include the
> &udev->dev device name and driver name? If it doesn't, there will be
> no way for the user to tell that the error message is related to the
> device failure.
The system will come to a grinding halt anyway if it can't allocate 24 or 40
bytes. Which is BTW more or less the amount of memory saved by killing
the useless (error) message.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] USB: hub: Delete an error message for a failed memory allocation in usb_hub_clear_tt_buf
2017-12-06 16:13 [PATCH] USB: hub: Delete an error message for a failed memory allocation in usb_hub_clear_tt_buffer( SF Markus Elfring
` (2 preceding siblings ...)
2017-12-06 17:27 ` Geert Uytterhoeven
@ 2017-12-06 20:05 ` Joe Perches
2017-12-06 21:18 ` Alan Stern
4 siblings, 0 replies; 6+ messages in thread
From: Joe Perches @ 2017-12-06 20:05 UTC (permalink / raw)
To: Alan Stern, SF Markus Elfring
Cc: linux-usb, Daniel Drake, Dmitry Fleytman, Eugene Korenevsky,
Geert Uytterhoeven, Greg Kroah-Hartman, Günter Röck,
Johan Hovold, Mathias Nyman, Peter Chen, LKML, kernel-janitors
On Wed, 2017-12-06 at 11:45 -0500, Alan Stern wrote:
> On Wed, 6 Dec 2017, SF Markus Elfring wrote:
> > Omit an extra message for a memory allocation failure in this function.
Markus' typical terrible commit message.
> > diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
[]
> > @@ -829,7 +829,6 @@ int usb_hub_clear_tt_buffer(struct urb *urb)
> > */
> > clear = kmalloc(sizeof *clear, GFP_ATOMIC);
> > if (clear = NULL) {
> > - dev_err(&udev->dev, "can't save CLEAR_TT_BUFFER state\n");
> > /* FIXME recover somehow ... RESET_TT? */
> > return -ENOMEM;
> > }
>
> Does the existing memory allocation error message include the
> &udev->dev device name and driver name? If it doesn't, there will be
> no way for the user to tell that the error message is related to the
> device failure.
No, but the effect is similar.
OOM does a dump_stack() so this function's call tree is shown.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] USB: hub: Delete an error message for a failed memory allocation in usb_hub_clear_tt_buf
2017-12-06 16:13 [PATCH] USB: hub: Delete an error message for a failed memory allocation in usb_hub_clear_tt_buffer( SF Markus Elfring
` (3 preceding siblings ...)
2017-12-06 20:05 ` Joe Perches
@ 2017-12-06 21:18 ` Alan Stern
4 siblings, 0 replies; 6+ messages in thread
From: Alan Stern @ 2017-12-06 21:18 UTC (permalink / raw)
To: Joe Perches
Cc: SF Markus Elfring, linux-usb, Daniel Drake, Dmitry Fleytman,
Eugene Korenevsky, Geert Uytterhoeven, Greg Kroah-Hartman,
Günter Röck, Johan Hovold, Mathias Nyman, Peter Chen,
LKML, kernel-janitors
On Wed, 6 Dec 2017, Joe Perches wrote:
> On Wed, 2017-12-06 at 11:45 -0500, Alan Stern wrote:
> > On Wed, 6 Dec 2017, SF Markus Elfring wrote:
> > > Omit an extra message for a memory allocation failure in this function.
>
> Markus' typical terrible commit message.
>
> > > diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> []
> > > @@ -829,7 +829,6 @@ int usb_hub_clear_tt_buffer(struct urb *urb)
> > > */
> > > clear = kmalloc(sizeof *clear, GFP_ATOMIC);
> > > if (clear = NULL) {
> > > - dev_err(&udev->dev, "can't save CLEAR_TT_BUFFER state\n");
> > > /* FIXME recover somehow ... RESET_TT? */
> > > return -ENOMEM;
> > > }
> >
> > Does the existing memory allocation error message include the
> > &udev->dev device name and driver name? If it doesn't, there will be
> > no way for the user to tell that the error message is related to the
> > device failure.
>
> No, but the effect is similar.
>
> OOM does a dump_stack() so this function's call tree is shown.
A call stack doesn't tell you which device was being handled.
Alan Stern
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-12-06 21:18 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-06 16:13 [PATCH] USB: hub: Delete an error message for a failed memory allocation in usb_hub_clear_tt_buffer( SF Markus Elfring
2017-12-06 16:45 ` [PATCH] USB: hub: Delete an error message for a failed memory allocation in usb_hub_clear_tt_buf Alan Stern
2017-12-06 16:57 ` Greg Kroah-Hartman
2017-12-06 17:27 ` Geert Uytterhoeven
2017-12-06 20:05 ` Joe Perches
2017-12-06 21:18 ` Alan Stern
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).