lkml.org 
[lkml]   [2014]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] HID: wacom: Prevent potential null dereference after disconnect
On Wed, Oct 08, 2014 at 11:25:42AM -0700, Jason Gerecke wrote:
> Repeated connect/disconnect cycles under GNOME can trigger an occasional
> OOPS from within e.g. wacom_led_select_store, presumably due to a timing
> issue where userspace begins setting a value immediately before the
> device disconnects and our shared data is whisked away.
>
> Signed-off-by: Jason Gerecke <killertofu@gmail.com>
> ---
> Changes in v2:
> * Added in missing escape character
>
> drivers/hid/wacom_sys.c | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
> index 8593047..265429b 100644
> --- a/drivers/hid/wacom_sys.c
> +++ b/drivers/hid/wacom_sys.c
> @@ -641,6 +641,9 @@ static ssize_t wacom_led_select_store(struct device *dev, int set_id,
> unsigned int id;
> int err;
>
> + if (!wacom)
> + return -ENODEV;
> +

Strong NAK. If device could disappear before this check it could as well
disappear after your check.

This patch does not solve anything.

> err = kstrtouint(buf, 10, &id);
> if (err)
> return err;

Thanks.

--
Dmitry


\
 
 \ /
  Last update: 2014-10-09 00:21    [W:0.050 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site