USB: whci-hcd: fix NULL dereference on allocation failure
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 20 Jul 2012 06:58:16 +0000 (09:58 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Aug 2012 22:17:39 +0000 (15:17 -0700)
commit3821bf4abb7f78c90af7fa2975df6618906b11ec
tree4ac3fbae82c1d034713ecf31b3c34479fb98b6fc
parent644034c21209feaddd6d584669ffb40561525d18
USB: whci-hcd: fix NULL dereference on allocation failure

If usb_create_hcd() fails here then we dereference "whc" inside the call
to whc_clean_up() before it has been set.  The compiler would have
warned about this if we hadn't initialized all the pointers to NULL at
the start of the function.  I've cleaned that up as well.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/whci/hcd.c