lkml.org 
[lkml]   [2017]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] generic-adc-battery: Delete an error message for a failed memory allocation in gab_probe()
Date
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 17 Dec 2017 21:10:51 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/power/supply/generic-adc-battery.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/power/supply/generic-adc-battery.c b/drivers/power/supply/generic-adc-battery.c
index 28dc056eaafa..bac71719091a 100644
--- a/drivers/power/supply/generic-adc-battery.c
+++ b/drivers/power/supply/generic-adc-battery.c
@@ -247,10 +247,8 @@ static int gab_probe(struct platform_device *pdev)
int index = 0;

adc_bat = devm_kzalloc(&pdev->dev, sizeof(*adc_bat), GFP_KERNEL);
- if (!adc_bat) {
- dev_err(&pdev->dev, "failed to allocate memory\n");
+ if (!adc_bat)
return -ENOMEM;
- }

psy_cfg.drv_data = adc_bat;
psy_desc = &adc_bat->psy_desc;
--
2.15.1
\
 
 \ /
  Last update: 2017-12-17 21:16    [W:0.024 / U:20.824 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site