lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-id: <20161130114028epcms5p8f4d171c212743cb3c9644869beb85fe2@epcms5p8>
Date:   Wed, 30 Nov 2016 11:40:28 +0000
From:   Atul Raj <atul.r@...sung.com>
To:     Viresh Kumar <viresh.kumar@...aro.org>,
        gregkh@...uxfoundation.org 
        <gregkh@...uxfoundation.org>,
        mathias.nyman@...ux.intel.com 
        <mathias.nyman@...ux.intel.com>,
        stern@...land.harvard.edu 
        <stern@...land.harvard.edu>,
        baolu.lu@...ux.intel.com 
        <baolu.lu@...ux.intel.com>,
        oneukum@...e.com <oneukum@...e.com>,
        hansy@...dia.com <hansy@...dia.com>,
        alcooperx@...il.com <alcooperx@...il.com>
Cc:     atulraj.nith@...il.com 
        <atulraj.nith@...il.com>,
        dri-devel@...ts.freedesktop.org 
        <dri-devel@...ts.freedesktop.org>,
        linux-kernel@...r.kernel.org 
        <linux-kernel@...r.kernel.org>
Subject: RE: RE: [PATCH v2] usb: core:hub.c: do not print error log on -enomem

 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@...sung.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
 >  
 >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ