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/dell-smo8800: Delete an error message for a failed memory allocation in smo8800_add()
Date
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 19 Dec 2017 21:12:10 +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/dell-smo8800.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/platform/x86/dell-smo8800.c b/drivers/platform/x86/dell-smo8800.c
index 1d87237bc731..9590d5e7c5ca 100644
--- a/drivers/platform/x86/dell-smo8800.c
+++ b/drivers/platform/x86/dell-smo8800.c
@@ -150,10 +150,8 @@ static int smo8800_add(struct acpi_device *device)
struct smo8800_device *smo8800;

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

smo8800->dev = &device->dev;
smo8800->miscdev.minor = MISC_DYNAMIC_MINOR;
--
2.15.1
\
 
 \ /
  Last update: 2017-12-19 21:19    [W:0.026 / U:0.784 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site