lkml.org 
[lkml]   [2018]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] hsi_char: Delete an error message for a failed memory allocation in hsc_probe()
Date
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 2 Feb 2018 21:21:12 +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/hsi/clients/hsi_char.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/hsi/clients/hsi_char.c b/drivers/hsi/clients/hsi_char.c
index cf9c2a332ad8..9d2a6d64dfb8 100644
--- a/drivers/hsi/clients/hsi_char.c
+++ b/drivers/hsi/clients/hsi_char.c
@@ -697,10 +697,9 @@ static int hsc_probe(struct device *dev)
int i;

cl_data = kzalloc(sizeof(*cl_data), GFP_KERNEL);
- if (!cl_data) {
- dev_err(dev, "Could not allocate hsc_client_data\n");
+ if (!cl_data)
return -ENOMEM;
- }
+
hsc_baseminor = HSC_BASEMINOR(hsi_id(cl), hsi_port_id(cl));
if (!hsc_major) {
ret = alloc_chrdev_region(&hsc_dev, hsc_baseminor,
--
2.16.1
\
 
 \ /
  Last update: 2018-02-02 21:26    [W:0.057 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site