[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1209191354110.31149@pobox.suse.cz>
Date: Wed, 19 Sep 2012 13:55:24 +0200 (CEST)
From: Jiri Kosina <jkosina@...e.cz>
To: Kevin Daughtridge <kevin@...u.com>
Cc: linux-input@...r.kernel.org, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org, Henrik Rydberg <rydberg@...omail.se>
Subject: Re: [PATCH v2] HID: leave dev_rdesc unmodified and use it for
comparisons
On Tue, 18 Sep 2012, Kevin Daughtridge wrote:
> The dev_rdesc member of the hid_device structure is meant to store the
> original
> report descriptor received from the device, but it is currently passed to any
> report_fixup method before it is copied to the rdesc member. This patch moves
> the kmemdup to before, not after, the report_fixup call, keeping dev_rdesc
> unchanged.
>
> usbhid's hid_post_reset checks the report descriptor currently returned by the
> device against a descriptor that may have been modified by a driver's
> report_fixup method. That leaves some devices nonfunctional after a resume,
> with
> a "reset_resume error 1" reported. This patch checks the new descriptor
> against
> the unmodified dev_rdesc instead.
>
> BugLink:http://bugs.launchpad.net/bugs/1049623
> Signed-off-by: Kevin Daughtridge<kevin@...u.com>
Your patch is whitespace damaged again, please fix your workload Kevin.
> ---
> --- a/drivers/hid/hid-core.c
> +++ b/drivers/hid/hid-core.c
> @@ -775,12 +775,14 @@ int hid_open_report(struct hid_device *d
> return -ENODEV;
> size = device->dev_rsize;
> + start = kmemdup(start, size, GFP_KERNEL);
> + if (start == NULL)
> + return -ENOMEM;
> +
How do you avoid memory leak on 'start' here?
--
Jiri Kosina
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists