[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200929074847.47124-1-jingxiangfeng@huawei.com>
Date: Tue, 29 Sep 2020 15:48:47 +0800
From: Jing Xiangfeng <jingxiangfeng@...wei.com>
To: <mchehab+huawei@...nel.org>, <gregkh@...uxfoundation.org>
CC: <devel@...verdev.osuosl.org>, <linux-kernel@...r.kernel.org>,
<jingxiangfeng@...wei.com>
Subject: [PATCH] staging: mfd: hi6421-spmi-pmic: Fix error return in hi6421_spmi_pmic_probe()
Fix to return error code -ENOMEM from the error handling case instead
of 0.
Signed-off-by: Jing Xiangfeng <jingxiangfeng@...wei.com>
---
drivers/staging/hikey9xx/hi6421-spmi-pmic.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
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);
--
2.26.0.106.g9fadedd
Powered by blists - more mailing lists