linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* possible missing error handling in hidraw
@ 2012-04-25 13:12 Oliver Neukum
  2012-04-26 22:56 ` Jiri Kosina
  0 siblings, 1 reply; 6+ messages in thread
From: Oliver Neukum @ 2012-04-25 13:12 UTC (permalink / raw)
  To: Jiri Kosina, linux-input

Hi,

what happens if kmemdup here cannot allocate memory?

	Regards
		Oliver

void hidraw_report_event(struct hid_device *hid, u8 *data, int len)
{
        struct hidraw *dev = hid->hidraw;
        struct hidraw_list *list;

        list_for_each_entry(list, &dev->list, node) {
                list->buffer[list->head].value = kmemdup(data, len, GFP_ATOMIC);
                list->buffer[list->head].len = len;
                list->head = (list->head + 1) & (HIDRAW_BUFFER_SIZE - 1);
                kill_fasync(&list->fasync, SIGIO, POLL_IN);
        }

        wake_up_interruptible(&dev->wait);
}
EXPORT_SYMBOL_GPL(hidraw_report_event);

-- 
- - - 
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) 
Maxfeldstraße 5                         
90409 Nürnberg 
Germany 
- - - 
--
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-04-27 12:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-25 13:12 possible missing error handling in hidraw Oliver Neukum
2012-04-26 22:56 ` Jiri Kosina
2012-04-27  7:36   ` James Woodcock
2012-04-27  7:47     ` Jiri Kosina
2012-04-27  9:26       ` Oliver Neukum
2012-04-27 12:35         ` Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).