HID: fix incorrect free in hiddev
authorJohannes Weiner <hannes@cmpxchg.org>
Tue, 10 Mar 2009 21:43:56 +0000 (22:43 +0100)
committerJiri Kosina <jkosina@suse.cz>
Tue, 10 Mar 2009 21:43:56 +0000 (22:43 +0100)
If hiddev_open() fails, it wrongly frees the shared hiddev structure
kept in hiddev_table instead of the hiddev_list structure allocated
for the opened file descriptor.  Existing references to this structure
will then accessed free memory.

This was introduced by 079034073 "HID: hiddev cleanup -- handle all
error conditions properly".

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Oliver Neukum <oliver@neukum.name>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

No differences found