Commit af3d305c authored by Harvey Harrison's avatar Harvey Harrison Committed by Greg Kroah-Hartman
Browse files

usb: fix integer as NULL pointer warnings found by sparse



drivers/usb/host/ohci-sm501.c:93:24: warning: Using plain integer as NULL pointer
drivers/usb/gadget/amd5536udc.c:3254:9: warning: Using plain integer as NULL pointer
drivers/usb/gadget/amd5536udc.c:3267:9: warning: Using plain integer as NULL pointer
drivers/usb/gadget/amd5536udc.c:3277:9: warning: Using plain integer as NULL pointer
drivers/usb/gadget/amd5536udc.c:3285:9: warning: Using plain integer as NULL pointer
drivers/usb/gadget/amd5536udc.c:3293:9: warning: Using plain integer as NULL pointer
Signed-off-by: default avatarHarvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 22026473
...@@ -3251,7 +3251,7 @@ static int udc_pci_probe( ...@@ -3251,7 +3251,7 @@ static int udc_pci_probe(
/* pci setup */ /* pci setup */
if (pci_enable_device(pdev) < 0) { if (pci_enable_device(pdev) < 0) {
kfree(dev); kfree(dev);
dev = 0; dev = NULL;
retval = -ENODEV; retval = -ENODEV;
goto finished; goto finished;
} }
...@@ -3264,7 +3264,7 @@ static int udc_pci_probe( ...@@ -3264,7 +3264,7 @@ static int udc_pci_probe(
if (!request_mem_region(resource, len, name)) { if (!request_mem_region(resource, len, name)) {
dev_dbg(&pdev->dev, "pci device used already\n"); dev_dbg(&pdev->dev, "pci device used already\n");
kfree(dev); kfree(dev);
dev = 0; dev = NULL;
retval = -EBUSY; retval = -EBUSY;
goto finished; goto finished;
} }
...@@ -3274,7 +3274,7 @@ static int udc_pci_probe( ...@@ -3274,7 +3274,7 @@ static int udc_pci_probe(
if (dev->virt_addr == NULL) { if (dev->virt_addr == NULL) {
dev_dbg(&pdev->dev, "start address cannot be mapped\n"); dev_dbg(&pdev->dev, "start address cannot be mapped\n");
kfree(dev); kfree(dev);
dev = 0; dev = NULL;
retval = -EFAULT; retval = -EFAULT;
goto finished; goto finished;
} }
...@@ -3282,7 +3282,7 @@ static int udc_pci_probe( ...@@ -3282,7 +3282,7 @@ static int udc_pci_probe(
if (!pdev->irq) { if (!pdev->irq) {
dev_err(&dev->pdev->dev, "irq not set\n"); dev_err(&dev->pdev->dev, "irq not set\n");
kfree(dev); kfree(dev);
dev = 0; dev = NULL;
retval = -ENODEV; retval = -ENODEV;
goto finished; goto finished;
} }
...@@ -3290,7 +3290,7 @@ static int udc_pci_probe( ...@@ -3290,7 +3290,7 @@ static int udc_pci_probe(
if (request_irq(pdev->irq, udc_irq, IRQF_SHARED, name, dev) != 0) { if (request_irq(pdev->irq, udc_irq, IRQF_SHARED, name, dev) != 0) {
dev_dbg(&dev->pdev->dev, "request_irq(%d) fail\n", pdev->irq); dev_dbg(&dev->pdev->dev, "request_irq(%d) fail\n", pdev->irq);
kfree(dev); kfree(dev);
dev = 0; dev = NULL;
retval = -EBUSY; retval = -EBUSY;
goto finished; goto finished;
} }
......
...@@ -90,7 +90,7 @@ static int ohci_hcd_sm501_drv_probe(struct platform_device *pdev) ...@@ -90,7 +90,7 @@ static int ohci_hcd_sm501_drv_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct resource *res, *mem; struct resource *res, *mem;
int retval, irq; int retval, irq;
struct usb_hcd *hcd = 0; struct usb_hcd *hcd = NULL;
irq = retval = platform_get_irq(pdev, 0); irq = retval = platform_get_irq(pdev, 0);
if (retval < 0) if (retval < 0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment