lkml.org 
[lkml]   [2007]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][hid] Fix a NULL pointer dereference when we fail to allocate memory
On Sun, 22 Jul 2007, Jesper Juhl wrote:

> If, in usb_hid_configure(), we fail to allocate storage for 'usbhid',
> "if (!(usbhid = kzalloc(sizeof(struct usbhid_device), GFP_KERNEL)))",
> then we'll jump to the 'fail:' label where we have this code:
> usb_free_urb(usbhid->urbin);
> usb_free_urb(usbhid->urbout);
> usb_free_urb(usbhid->urbctrl);
> Since we got here because we couldn't allocate storage for 'usbhid',
> what we have here is a NULL pointer dereference - ouch...

Hi Jesper,

thanks a lot for noticing this, I have queued your patch in HID tree.

(and sorry for late reply, I was offline on vacation for some time).

--
Jiri Kosina
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-07-30 15:25    [W:0.052 / U:0.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site