lkml.org 
[lkml]   [2017]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] platform/x86/mlxcpld-hotplug: Delete an error message for a failed memory allocation in mlxcpld_hotplug_attr_init()
Date
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 19 Dec 2017 20:56:56 +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/platform/x86/mlxcpld-hotplug.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/platform/x86/mlxcpld-hotplug.c b/drivers/platform/x86/mlxcpld-hotplug.c
index aff3686b3b37..d45cb8be221f 100644
--- a/drivers/platform/x86/mlxcpld-hotplug.c
+++ b/drivers/platform/x86/mlxcpld-hotplug.c
@@ -165,11 +165,8 @@ static int mlxcpld_hotplug_attr_init(struct mlxcpld_hotplug_priv_data *priv)
PRIV_DEV_ATTR(i).nr = MLXCPLD_HOTPLUG_ATTR_TYPE_FAN;
}

- if (!PRIV_ATTR(i)->name) {
- dev_err(&priv->pdev->dev, "Memory allocation failed for sysfs attribute %d.\n",
- i + 1);
+ if (!PRIV_ATTR(i)->name)
return -ENOMEM;
- }

PRIV_DEV_ATTR(i).dev_attr.attr.name = PRIV_ATTR(i)->name;
PRIV_DEV_ATTR(i).dev_attr.attr.mode = S_IRUGO;
--
2.15.1
\
 
 \ /
  Last update: 2017-12-19 21:05    [W:0.046 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site