mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
powerpc/pseries: Add null property check to pseries_discover_pic()
The return value of of_get_property() isn't checked before it is passed to the strstr() function, if it happens that the return value is null then this will result in a null pointer being dereferenced. Add a check to see if the return value of of_get_property() is null and if it is continue straight on to the next node. Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com> Reviewed-by: Chris Smart <chris@distroguy.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
parent
9e44754755
commit
b2ed059642
1 changed files with 2 additions and 0 deletions
|
@ -235,6 +235,8 @@ static void __init pseries_discover_pic(void)
|
||||||
|
|
||||||
for_each_node_by_name(np, "interrupt-controller") {
|
for_each_node_by_name(np, "interrupt-controller") {
|
||||||
typep = of_get_property(np, "compatible", NULL);
|
typep = of_get_property(np, "compatible", NULL);
|
||||||
|
if (!typep)
|
||||||
|
continue;
|
||||||
if (strstr(typep, "open-pic")) {
|
if (strstr(typep, "open-pic")) {
|
||||||
pSeries_mpic_node = of_node_get(np);
|
pSeries_mpic_node = of_node_get(np);
|
||||||
ppc_md.init_IRQ = pseries_mpic_init_IRQ;
|
ppc_md.init_IRQ = pseries_mpic_init_IRQ;
|
||||||
|
|
Loading…
Add table
Reference in a new issue