Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75c6d141 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by David S. Miller
Browse files

[SPARC64]: check for possible NULL pointer dereference



This patch adds checking for possible NULL pointer dereference
if of_find_property() failed.

Signed-off-by: default avatarCyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 794b26e0
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1022,6 +1022,10 @@ void __init sun4v_pci_init(struct device_node *dp, char *model_name)
	}

	prop = of_find_property(dp, "reg", NULL);
	if (!prop) {
		prom_printf("SUN4V_PCI: Could not find config registers\n");
		prom_halt();
	}
	regs = prop->value;

	devhandle = (regs->phys_addr >> 32UL) & 0x0fffffff;