HID: fix suspend crash by moving initializations earlier
commit3df1ba0d074919fef36e919220aec1b379d82684
authorAlan Stern <stern@rowland.harvard.edu>
Fri, 7 May 2010 14:41:10 +0000 (7 10:41 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 20 Sep 2010 20:17:51 +0000 (20 13:17 -0700)
tree37a899d95e8ba420e2e9c967e93c94027dbd4331
parentc7260ac8c7a413285419dd3835e81d43ec39fba6
HID: fix suspend crash by moving initializations earlier

commit fde4e2f73208b8f34f123791e39c0cb6bc74b32a upstream.

Although the usbhid driver allocates its usbhid structure in the probe
routine, several critical fields in that structure don't get
initialized until usbhid_start().  However if report descriptor
parsing fails then usbhid_start() is never called.  This leads to
problems during system suspend -- the system will freeze.

This patch (as1378) fixes the bug by moving the initialization
statements up into usbhid_probe().

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Bruno Prémont <bonbons@linux-vserver.org>
Tested-By: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Cc: maximilian attems <max@stro.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/hid/usbhid/hid-core.c