Message ID | 1353478830-23788-2-git-send-email-sachin.kamat@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Delegated to: | Jiri Kosina |
Headers | show |
On Wed, 21 Nov 2012 11:50:30 +0530 Sachin Kamat <sachin.kamat@linaro.org> wrote: > This avoids a possible NULL pointer dereference error when report > is NULL. This is wrong. Please see the patch I sent a while ago - it can't be NULL, the check just needs removing. -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Jonathan, Please check and merge Alan Cox's patch. I have forwarded this patch to you. Thanks, Srinivas On 11/21/2012 04:42 AM, Alan Cox wrote: > On Wed, 21 Nov 2012 11:50:30 +0530 > Sachin Kamat <sachin.kamat@linaro.org> wrote: > >> This avoids a possible NULL pointer dereference error when report >> is NULL. > This is wrong. Please see the patch I sent a while ago - it can't be > NULL, the check just needs removing. > -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, 21 Nov 2012, Srinivas Pandruvada wrote:
> Please check and merge Alan Cox's patch. I have forwarded this patch to you.
I have already applied the patch to my tree.
diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c index d9d73e9..29f8071 100644 --- a/drivers/hid/hid-sensor-hub.c +++ b/drivers/hid/hid-sensor-hub.c @@ -428,6 +428,9 @@ static int sensor_hub_raw_event(struct hid_device *hdev, struct hid_collection *collection = NULL; void *priv = NULL; + if (!report) + goto err_report; + hid_dbg(hdev, "sensor_hub_raw_event report id:0x%x size:%d type:%d\n", report->id, size, report->type); hid_dbg(hdev, "maxfield:%d\n", report->maxfield); @@ -437,9 +440,6 @@ static int sensor_hub_raw_event(struct hid_device *hdev, ptr = raw_data; ptr++; /*Skip report id*/ - if (!report) - goto err_report; - spin_lock_irqsave(&pdata->lock, flags); for (i = 0; i < report->maxfield; ++i) {
This avoids a possible NULL pointer dereference error when report is NULL. Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> --- drivers/hid/hid-sensor-hub.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)