]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
Xilinx: ARM: USB: Fixed kernel crash with OTG driver.
authorNaveen Mamindlapalli <naveenm@xilinx.com>
Thu, 11 Oct 2012 13:25:16 +0000 (18:55 +0530)
committerJohn Linn <john.linn@xilinx.com>
Thu, 11 Oct 2012 17:34:32 +0000 (10:34 -0700)
Fixed the kernel crash with 3.5 changes.

drivers/usb/otg/xilinx_usbps_otg.c

index 73dd2732331c70e3d1580c75f3d283ce8234de29..1a7c1638ee5dabd14d308300f3347f1af4d21c7a 100755 (executable)
@@ -1980,6 +1980,13 @@ static int xusbps_otg_probe(struct platform_device *pdev)
        }
        the_transceiver = xotg;
 
+       xotg->otg.otg = kzalloc(sizeof(struct usb_otg), GFP_KERNEL);
+       if (!xotg->otg.otg) {
+               kfree(xotg);
+               retval = -ENOMEM;
+               goto done;
+       }
+
        xotg->base = pdata->regs;
        xotg->irq = pdata->irq;
        if (!xotg->base || !xotg->irq) {