# Re: \[PATCH RESEND\] USB HID: Protect against disconnect/NULL-dereference race

- From: Jiri Kosina \<hidden\>
- Date: 2010-08-13 09:21:50 
- List: linux-input
- Page: https://ratatoskr.run/linux-input/2010/08/8914541
- Thread: https://ratatoskr.run/linux-input/2010/08/8914541/t.md

```text
On Thu, 12 Aug 2010, Chris Ball wrote:

> 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 <redacted>

Applied, thanks Chris.

-- 
Jiri Kosina
SUSE Labs, Novell Inc.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
```
