diff options
author | Andrew Goodbody <andrew.goodbody@linaro.org> | 2025-07-23 11:58:04 +0100 |
---|---|---|
committer | Casey Connolly <casey.connolly@linaro.org> | 2025-08-13 15:17:46 +0200 |
commit | 8a0bb0b176069989d645e1edca2737d46770a530 (patch) | |
tree | 957c064224a3a30a840c5d0faca80fcfef02515f /drivers/button/button-qcom-pmic.c | |
parent | 10e65926a37d06831fc913221f9eb930c4194060 (diff) |
button: qcom-pmic: Fix dereference of uninitialised pointer
The pointer 'label' is declared and later dereferenced without ever
having a value assigned to it. Add an assignment to this pointer so it
will be valid later when dereferenced.
This issue was found by Smatch.
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Casey Connolly <casey.connolly@linaro.org>
Link: https://lore.kernel.org/r/20250723-button-qcom-pmic-v1-1-9c317ac71167@linaro.org
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
Diffstat (limited to 'drivers/button/button-qcom-pmic.c')
-rw-r--r-- | drivers/button/button-qcom-pmic.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/button/button-qcom-pmic.c b/drivers/button/button-qcom-pmic.c index 85addfe32a2..b823490d6d5 100644 --- a/drivers/button/button-qcom-pmic.c +++ b/drivers/button/button-qcom-pmic.c @@ -195,8 +195,9 @@ static int button_qcom_pmic_bind(struct udevice *parent) continue; } + label = ofnode_get_name(node); ret = device_bind_driver_to_node(parent, "qcom_pwrkey", - ofnode_get_name(node), + label, node, &dev); if (ret) { printf("Failed to bind %s! %d\n", label, ret); |