]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
USB: Phidget: fix race in device_create
authorGreg Kroah-Hartman <gregkh@suse.de>
Sat, 17 May 2008 00:55:12 +0000 (17:55 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 20 May 2008 20:31:56 +0000 (13:31 -0700)
commitbfd3a5a96c1dd432303fdf2283e770419f6aecb3
treeadb06015b35d85b606d2dcf3440207e6ad1b783e
parentc5fb920aec2090a44aa4c33546b9f3c3affa538c
USB: Phidget: fix race in device_create

There is a race from when a device is created with device_create() and
then the drvdata is set with a call to dev_set_drvdata() in which a
sysfs file could be open, yet the drvdata will be NULL, causing all
sorts of bad things to happen.

This patch fixes the problem by using the new function,
device_create_drvdata().  It fixes all 3 phidget drivers, which all have
the same problem.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Sean Young <sean@mess.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/misc/phidgetkit.c
drivers/usb/misc/phidgetmotorcontrol.c
drivers/usb/misc/phidgetservo.c