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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 6 Mar 2017 08:09:00 +0100
From:   Michał Kępień <kernel@...pniu.pl>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Dmitry Torokhov <dmitry.torokhov@...il.com>,
        linux-input <linux-input@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] Input: sparse-keymap - use a managed allocation for
 keymap copy

> On Thu, Mar 2, 2017 at 2:02 PM, Michał Kępień <kernel@...pniu.pl> wrote:
> > Some platform drivers use devm_input_allocate_device() together with
> > sparse_keymap_setup() in their .probe callbacks.  While using the former
> > simplifies error handling, using the latter necessitates calling
> > sparse_keymap_free() in the error path and upon module unloading to
> > avoid leaking the copy of the keymap allocated by sparse_keymap_setup().
> >
> > To help prevent such leaks and enable simpler error handling, make
> > sparse_keymap_setup() use devm_kcalloc() to allocate memory for the
> > keymap copy so that it gets automatically freed.
> 
> > + * Since sparse_keymap_setup() now uses a managed allocation for the
> > + * keymap copy, use of this function is deprecated.
> 
> So...
> 
> >   */
> >  void sparse_keymap_free(struct input_dev *dev)
> 
> ... add __deprecated then?

Sure, I can do that if Dmitry recognizes this patch as otherwise sane.
I have never used that attribute before, so thanks for the tip.

-- 
Best regards,
Michał Kępień

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ