[PATCH v2] usb: xhci-pci: Check for errors from dm_pci_map_bar()

Bin Meng bmeng.cn at gmail.com
Mon Jan 18 12:44:32 CET 2021


On Mon, Jan 18, 2021 at 7:30 PM Pali Rohár <pali at kernel.org> wrote:
>
> Function dm_pci_map_bar() may fail and returns NULL. Check this to prevent
> dereferencing a NULL pointer.
>
> In xhci-pci this may happen when board does not enable CONFIG_PCI_PNP and
> PCI_BASE_ADDRESS_0 contains unconfigured zero address.
>
> Signed-off-by: Pali Rohár <pali at kernel.org>
> ---
>  drivers/usb/host/xhci-pci.c | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn at gmail.com>


More information about the U-Boot mailing list