diff mbox

Input: adp5520-keys: Delete an error message for a failed memory allocation in adp5520_keys_probe()

Message ID 9d0729d2-59ab-f116-aa12-0457ebde0041@users.sourceforge.net (mailing list archive)
State New, archived
Headers show

Commit Message

SF Markus Elfring Jan. 27, 2018, 2:20 p.m. UTC
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 27 Jan 2018 15:15:52 +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/input/keyboard/adp5520-keys.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Hennerich, Michael Feb. 1, 2018, 4:27 p.m. UTC | #1
On 27.01.2018 15:20, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 27 Jan 2018 15:15:52 +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>

Acked-by: Michael Hennerich <michael.hennerich@analog.com>

> ---
>   drivers/input/keyboard/adp5520-keys.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/input/keyboard/adp5520-keys.c b/drivers/input/keyboard/adp5520-keys.c
> index f0b9b37bde58..72e01cb77881 100644
> --- a/drivers/input/keyboard/adp5520-keys.c
> +++ b/drivers/input/keyboard/adp5520-keys.c
> @@ -91,10 +91,8 @@ static int adp5520_keys_probe(struct platform_device *pdev)
>   		return -EINVAL;
>   
>   	dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
> -	if (!dev) {
> -		dev_err(&pdev->dev, "failed to alloc memory\n");
> +	if (!dev)
>   		return -ENOMEM;
> -	}
>   
>   	input = devm_input_allocate_device(&pdev->dev);
>   	if (!input)
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/input/keyboard/adp5520-keys.c b/drivers/input/keyboard/adp5520-keys.c
index f0b9b37bde58..72e01cb77881 100644
--- a/drivers/input/keyboard/adp5520-keys.c
+++ b/drivers/input/keyboard/adp5520-keys.c
@@ -91,10 +91,8 @@  static int adp5520_keys_probe(struct platform_device *pdev)
 		return -EINVAL;
 
 	dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
-	if (!dev) {
-		dev_err(&pdev->dev, "failed to alloc memory\n");
+	if (!dev)
 		return -ENOMEM;
-	}
 
 	input = devm_input_allocate_device(&pdev->dev);
 	if (!input)