Reset gpio is optional and it does not have to be defined for all boards. So in mvebu_pcie_powerdown() like in mvebu_pcie_powerup() check that reset gpio is defined prior usage to prevent NULL pointer dereference. Signed-off-by: Pali Rohár <pali@xxxxxxxxxx> --- drivers/pci/controller/pci-mvebu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/pci-mvebu.c b/drivers/pci/controller/pci-mvebu.c index 153a64676bc9..58607cbe84c8 100644 --- a/drivers/pci/controller/pci-mvebu.c +++ b/drivers/pci/controller/pci-mvebu.c @@ -947,7 +947,8 @@ static int mvebu_pcie_powerup(struct mvebu_pcie_port *port) */ static void mvebu_pcie_powerdown(struct mvebu_pcie_port *port) { - gpiod_set_value_cansleep(port->reset_gpio, 1); + if (port->reset_gpio) + gpiod_set_value_cansleep(port->reset_gpio, 1); clk_disable_unprepare(port->clk); } -- 2.20.1