[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.1705021445220.1568-100000@iolanthe.rowland.org>
Date: Tue, 2 May 2017 14:45:35 -0400 (EDT)
From: Alan Stern <stern@...land.harvard.edu>
To: "Gustavo A. R. Silva" <garsilva@...eddedor.com>
cc: Felipe Balbi <balbi@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jussi Kivilinna <jussi.kivilinna@...tian.com>,
Colin Ian King <colin.king@...onical.com>,
Tim Harvey <tharvey@...eworks.com>,
Raz Manor <Raz.Manor@...ens.com>, <linux-usb@...r.kernel.org>,
<linux-kernel@...r.kernel.org>,
Peter Senna Tschudin <peter.senna@...il.com>
Subject: Re: [PATCH v2] usb: gadget: udc: add null check before pointer
dereference
On Tue, 2 May 2017, Gustavo A. R. Silva wrote:
> Add null check before dereferencing dev->regs pointer inside
> net2280_led_shutdown() function.
>
> Addresses-Coverity-ID: 101783
> Cc: Alan Stern <stern@...land.harvard.edu>
> Signed-off-by: Gustavo A. R. Silva <garsilva@...eddedor.com>
> ---
> Changes in v2:
> Move the net2280_led_shutdown() call later.
>
> drivers/usb/gadget/udc/net2280.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c
> index 3828c2e..4f5c0c4 100644
> --- a/drivers/usb/gadget/udc/net2280.c
> +++ b/drivers/usb/gadget/udc/net2280.c
> @@ -3573,7 +3573,6 @@ static void net2280_remove(struct pci_dev *pdev)
> BUG_ON(dev->driver);
>
> /* then clean up the resources we allocated during probe() */
> - net2280_led_shutdown(dev);
> if (dev->requests) {
> int i;
> for (i = 1; i < 5; i++) {
> @@ -3588,8 +3587,10 @@ static void net2280_remove(struct pci_dev *pdev)
> free_irq(pdev->irq, dev);
> if (dev->quirks & PLX_PCIE)
> pci_disable_msi(pdev);
> - if (dev->regs)
> + if (dev->regs) {
> + net2280_led_shutdown(dev);
> iounmap(dev->regs);
> + }
> if (dev->region)
> release_mem_region(pci_resource_start(pdev, 0),
> pci_resource_len(pdev, 0));
Acked-by: Alan Stern <stern@...land.harvard.edu>
Powered by blists - more mailing lists