From: Chris Ball Date: Thu, 12 Aug 2010 23:07:40 +0000 (-0400) Subject: HID: hiddev: protect against disconnect/NULL-dereference race X-Git-Tag: v2.6.36-rc2~35^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7032269e87ade34cc12891675371fa2ac150a620;p=pandora-kernel.git HID: hiddev: protect against disconnect/NULL-dereference race One of our users reports consistently hitting a NULL dereference that resolves to the "hid_to_usb_dev(hid);" call in hiddev_ioctl(), when disconnecting a Lego WeDo USB HID device from an OLPC XO running Scratch software. There's a FIXME comment and a guard against the dereference, but that happens farther down the function than the initial dereference does. This patch moves the call to be below the guard, and the user reports that it fixes the problem for him. OLPC bug report: http://dev.laptop.org/ticket/10174 Signed-off-by: Chris Ball Signed-off-by: Jiri Kosina --- Reading git-diff-tree failed