Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1533244
| From | Atul Raj <atul.r@samsung.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | RE: RE: [PATCH v2] usb: core:hub.c: do not print error log on -enomem |
| Date | 2016-11-30 12:50 +0100 |
| Message-ID | <sJbyF-5yf-3@gated-at.bofh.it> (permalink) |
| References | <sJbyF-5yf-5@gated-at.bofh.it> <sJbyF-5yf-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
[Multipart message — attachments visible in raw view] - view raw
changes in v2
- added braces as suggested.
drivers/usb/core/hub.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 749d595..82059f26 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -816,9 +816,10 @@ int usb_hub_clear_tt_buffer(struct urb *urb)
* there can be many TTs per hub). even if they're uncommon.
*/
clear = kmalloc(sizeof *clear, GFP_ATOMIC);
- if (clear == NULL)
+ if (clear == NULL) {
/* FIXME recover somehow ... RESET_TT? */
return -ENOMEM;
+ }
/* info that CLEAR_TT_BUFFER needs */
clear->tt = tt->multi ? udev->ttport : 1;
--
2.10.2.windows.1
> s/enomem/ENOMEM
>
> On 30-11-16, 06:32, Atul Raj wrote:
> > All kmalloc-based functions print enough information on failures.
> >
> > Signed-off-by: Atul Raj <atul.r@samsung.com>
> > ---
> > drivers/usb/core/hub.c | 4 +---
> > 1 file changed, 1 insertion(+), 3 deletions(-)
> >
> > diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> > index cbb1467..749d595 100644
> > --- a/drivers/usb/core/hub.c
> > +++ b/drivers/usb/core/hub.c
> > @@ -816,11 +816,9 @@ int usb_hub_clear_tt_buffer(struct urb *urb)
> > * there can be many TTs per hub). even if they're uncommon.
> > */
> > clear = kmalloc(sizeof *clear, GFP_ATOMIC);
> > - if (clear == NULL) {
> > - dev_err(&udev->dev, "can't save CLEAR_TT_BUFFER state\n");
> > + if (clear == NULL)
> > /* FIXME recover somehow ... RESET_TT? */
> > return -ENOMEM;
>
> It is still preferred to keep {} here as comment also takes a line.
>
> > - }
> >
> > /* info that CLEAR_TT_BUFFER needs */
> > clear->tt = tt->multi ? udev->ttport : 1;
> > --
> > 2.10.2.windows.1
>
>
> --
> viresh
>
>
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
RE: RE: [PATCH v2] usb: core:hub.c: do not print error log on -enomem Atul Raj <atul.r@samsung.com> - 2016-11-30 12:50 +0100 Re: RE: [PATCH v2] usb: core:hub.c: do not print error log on -enomem "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org> - 2016-11-30 13:00 +0100
csiph-web