mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
powerpc/macio: Don't dereference pointer before null check
Signed-off-by: Andreas Schwab <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
This commit is contained in:
parent
aef4b9aaae
commit
83aea945c2
1 changed files with 4 additions and 3 deletions
|
|
@ -492,8 +492,8 @@ static void macio_pci_add_devices(struct macio_chip *chip)
|
|||
}
|
||||
|
||||
/* Add media bay devices if any */
|
||||
pnode = mbdev->ofdev.dev.of_node;
|
||||
if (mbdev)
|
||||
if (mbdev) {
|
||||
pnode = mbdev->ofdev.dev.of_node;
|
||||
for (np = NULL; (np = of_get_next_child(pnode, np)) != NULL;) {
|
||||
if (macio_skip_device(np))
|
||||
continue;
|
||||
|
|
@ -502,10 +502,11 @@ static void macio_pci_add_devices(struct macio_chip *chip)
|
|||
mbdev, root_res) == NULL)
|
||||
of_node_put(np);
|
||||
}
|
||||
}
|
||||
|
||||
/* Add serial ports if any */
|
||||
pnode = sdev->ofdev.dev.of_node;
|
||||
if (sdev) {
|
||||
pnode = sdev->ofdev.dev.of_node;
|
||||
for (np = NULL; (np = of_get_next_child(pnode, np)) != NULL;) {
|
||||
if (macio_skip_device(np))
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Reference in a new issue