HID: uhid: avoid dangling pointers in uhid context
authorDavid Herrmann <dh.herrmann@gmail.com>
Tue, 29 Jul 2014 15:14:17 +0000 (17:14 +0200)
committerJiri Kosina <jkosina@suse.cz>
Mon, 25 Aug 2014 08:28:06 +0000 (03:28 -0500)
commit41c4a46423c08274ef83cdbd44bbd2066cba59bb
tree8d85cc93440209b831a5faf46ba2619c89b0b8c4
parent56c47754631b98624e844305709d6a296bde20d1
HID: uhid: avoid dangling pointers in uhid context

Avoid keeping uhid->rd_data and uhid->rd_size set in case
uhid_dev_create2() fails. This is non-critical as we never flip
uhid->running and thus never enter uhid_dev_destroy(). However, it's much
nicer for debugging if pointers are only set if they point to valid data.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/uhid.c