usbip: Fix uninitialized variable bug in vhci
authorYuyang Du <yuyang.du@intel.com>
Tue, 27 Jun 2017 15:44:26 +0000 (09:44 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Jun 2017 15:57:50 +0000 (17:57 +0200)
The patch 03cd00d538a6: "usbip: vhci-hcd: Set the vhci structure up
to work" introduced a bug which uses a vairable without initialization
in error handling code. Fix it.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Yuyang Du <yuyang.du@intel.com>
Acked-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/usbip/vhci_hcd.c

index 64c38603df7b80232fac0c7aa1c621e092f35e73..2c4b2fd4040617a7583ccdb92d0cbbb05aaf5164 100644 (file)
@@ -1301,7 +1301,7 @@ static struct hc_driver vhci_hc_driver = {
 
 static int vhci_hcd_probe(struct platform_device *pdev)
 {
-       struct vhci             *vhci;
+       struct vhci             *vhci = *((void **)dev_get_platdata(&pdev->dev));
        struct usb_hcd          *hcd_hs;
        struct usb_hcd          *hcd_ss;
        int                     ret;