Commit cab9a128 authored by Rickard Strandqvist's avatar Rickard Strandqvist Committed by Bjorn Helgaas

PCI: cpqphp: Fix possible null pointer dereference

There is otherwise a risk of a null pointer dereference.

Found by cppcheck, a static code analysis program.
Signed-off-by: default avatarRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent f0d54a54
......@@ -709,7 +709,8 @@ static struct pci_resource *get_max_resource(struct pci_resource **head, u32 siz
temp = temp->next;
}
temp->next = max->next;
if (temp)
temp->next = max->next;
}
max->next = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment