summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2017-01-10 12:27:03 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-01-10 12:27:03 -0800
commitaa7e73ef9f6ace020f212d4063ef9c328a2d957f (patch)
treebc225517385364bf35618ba27acdc4e9a5c63df0
parent7d4cf5211b879f67127e534cf586720269f6b379 (diff)
parente17f4cf09eaf319b703efa7db4188581dae156f0 (diff)
Merge "qpnp-pin: Fix null pointer access in qpnp_pin_debugfs_create()"
-rw-r--r--drivers/gpio/qpnp-pin.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpio/qpnp-pin.c b/drivers/gpio/qpnp-pin.c
index 483bb9338ac3..de24d99ea34e 100644
--- a/drivers/gpio/qpnp-pin.c
+++ b/drivers/gpio/qpnp-pin.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -1381,7 +1381,7 @@ static int qpnp_pin_debugfs_create(struct qpnp_pin_chip *q_chip)
return -ENODEV;
}
- for (i = 0; i < of_get_child_count(pdev->dev.of_node); i++) {
+ for (i = 0; i < q_chip->gpio_chip.ngpio; i++) {
q_spec = qpnp_chip_gpio_get_spec(q_chip, i);
params = q_spec->params;
snprintf(pmic_pin, DEBUGFS_BUF_SIZE, "%u", q_spec->pmic_pin);