summaryrefslogtreecommitdiffstats
path: root/drivers/staging/hikey9xx
diff options
context:
space:
mode:
authorWang Hai <wanghai38@huawei.com>2020-11-18 18:37:24 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-11-23 17:59:51 +0100
commitba3e4a2a0b3c639d3835f2f1dce27d79576ae453 (patch)
tree231c290112bcd5e498b2b39417ad843759b7f835 /drivers/staging/hikey9xx
parent1f59b0663d2db724d4fe8b8704cada916f795518 (diff)
staging: mfd: hi6421-spmi-pmic: fix error return code in hi6421_spmi_pmic_probe()
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 4524ac56cdca ("staging: mfd: add a PMIC driver for HiSilicon 6421 SPMI version") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wang Hai <wanghai38@huawei.com> Link: https://lore.kernel.org/r/20201118103724.57451-1-wanghai38@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/hikey9xx')
-rw-r--r--drivers/staging/hikey9xx/hi6421-spmi-pmic.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/hikey9xx/hi6421-spmi-pmic.c b/drivers/staging/hikey9xx/hi6421-spmi-pmic.c
index 64b30d263c8d..4f34a5282970 100644
--- a/drivers/staging/hikey9xx/hi6421-spmi-pmic.c
+++ b/drivers/staging/hikey9xx/hi6421-spmi-pmic.c
@@ -262,8 +262,10 @@ static int hi6421_spmi_pmic_probe(struct spmi_device *pdev)
hi6421_spmi_pmic_irq_prc(pmic);
pmic->irqs = devm_kzalloc(dev, HISI_IRQ_NUM * sizeof(int), GFP_KERNEL);
- if (!pmic->irqs)
+ if (!pmic->irqs) {
+ ret = -ENOMEM;
goto irq_malloc;
+ }
pmic->domain = irq_domain_add_simple(np, HISI_IRQ_NUM, 0,
&hi6421_spmi_domain_ops, pmic);