[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5cbf08e5-6c6a-4817-a370-8b193b04314a@linux.intel.com>
Date: Mon, 12 Nov 2018 10:11:32 -0800
From: sathyanarayanan kuppuswamy
<sathyanarayanan.kuppuswamy@...ux.intel.com>
To: balbi@...nel.org, gregkh@...uxfoundation.org
Cc: linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH v1 1/1] usb: dwc3: Fix NULL pointer exception in
dwc3_pci_remove()
Felipe/Greg,
Any comments ?
On 10/17/18 11:40 AM, Kuppuswamy Sathyanarayanan wrote:
> In dwc3_pci_quirks() function, gpiod lookup table is only registered for
> baytrail SOC. But in dwc3_pci_remove(), we try to unregistered it
> without any checks. This leads to NULL pointer de-reference exception in
> gpiod_remove_lookup_table() when unloading the module for non baytrail
> SOCs. This patch fixes this issue.
>
> Fixes: 5741022cbdf3 ("usb: dwc3: pci: Add GPIO lookup table on platforms
> without ACPI GPIO resources")
> Cc: <stable@...r.kernel.org>
> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@...ux.intel.com>
> Reviewed-by: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
> ---
> drivers/usb/dwc3/dwc3-pci.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
> index 1286076a8890..842795856bf4 100644
> --- a/drivers/usb/dwc3/dwc3-pci.c
> +++ b/drivers/usb/dwc3/dwc3-pci.c
> @@ -283,8 +283,10 @@ static int dwc3_pci_probe(struct pci_dev *pci, const struct pci_device_id *id)
> static void dwc3_pci_remove(struct pci_dev *pci)
> {
> struct dwc3_pci *dwc = pci_get_drvdata(pci);
> + struct pci_dev *pdev = dwc->pci;
>
> - gpiod_remove_lookup_table(&platform_bytcr_gpios);
> + if (pdev->device == PCI_DEVICE_ID_INTEL_BYT)
> + gpiod_remove_lookup_table(&platform_bytcr_gpios);
> #ifdef CONFIG_PM
> cancel_work_sync(&dwc->wakeup_work);
> #endif
--
Sathyanarayanan Kuppuswamy
Linux kernel developer
Powered by blists - more mailing lists