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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 14 Jun 2020 12:27:38 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Navid Emamdoost <navid.emamdoost@...il.com>
Cc:     Dmitry Torokhov <dmitry.torokhov@...il.com>,
        Jonathan Bakker <xc-racer2@...e.ca>,
        PaweĊ‚ Chmiel <pawel.mikolaj.chmiel@...il.com>,
        linux-input <linux-input@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Navid Emamdoost <emamd001@....edu>, wu000273@....edu,
        Kangjie Lu <kjlu@....edu>, Stephen McCamant <smccaman@....edu>
Subject: Re: [PATCH] Input: bma150: fix ref count leak in bma150_open

On Sun, Jun 14, 2020 at 8:58 AM Navid Emamdoost
<navid.emamdoost@...il.com> wrote:
>
> in bma150_open, pm_runtime_get_sync is called which
> increments the counter even in case of failure, leading to incorrect
> ref count. In case of failure, decrement the ref count before returning.

...

>         error = pm_runtime_get_sync(&bma150->client->dev);
>         if (error < 0 && error != -ENOSYS)
> -               return error;
> +               goto out;

So, what will happen in case of -ENOSYS?

...

> +       pm_runtime_put(&bma150->client->dev);

Slightly better to use _put_noidle(). (More consistency with error path)

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists