diff options
| author | Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> | 2014-05-18 12:02:57 -0400 |
|---|---|---|
| committer | Bjorn Helgaas <bhelgaas@google.com> | 2014-05-27 22:51:14 -0400 |
| commit | cab9a128dad0fa0c8400a03d9375c781dda43982 (patch) | |
| tree | d8d22dbf6548a0eca78e90b8f124c2b8d5cf9bf3 | |
| parent | f0d54a541751af2c6a16d0c081788cc2aef922a5 (diff) | |
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: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
| -rw-r--r-- | drivers/pci/hotplug/cpqphp_ctrl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c index 11845b796799..f593585f2784 100644 --- a/drivers/pci/hotplug/cpqphp_ctrl.c +++ b/drivers/pci/hotplug/cpqphp_ctrl.c | |||
| @@ -709,7 +709,8 @@ static struct pci_resource *get_max_resource(struct pci_resource **head, u32 siz | |||
| 709 | temp = temp->next; | 709 | temp = temp->next; |
| 710 | } | 710 | } |
| 711 | 711 | ||
| 712 | temp->next = max->next; | 712 | if (temp) |
| 713 | temp->next = max->next; | ||
| 713 | } | 714 | } |
| 714 | 715 | ||
| 715 | max->next = NULL; | 716 | max->next = NULL; |
