lkml.org 
[lkml]   [2017]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 1/2] [media] tuners: Delete an error message for a failed memory allocation in m88rs6000t_probe()
From
Date
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 16 Sep 2017 21:24:27 +0200

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

This issue was detected by using the Coccinelle software.

* Add a jump target so that the function "kfree" will be always called
with a non-null pointer.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/media/tuners/m88rs6000t.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/tuners/m88rs6000t.c b/drivers/media/tuners/m88rs6000t.c
index 9f3e0fd4cad9..d89793a05862 100644
--- a/drivers/media/tuners/m88rs6000t.c
+++ b/drivers/media/tuners/m88rs6000t.c
@@ -626,6 +626,5 @@ static int m88rs6000t_probe(struct i2c_client *client,
if (!dev) {
ret = -ENOMEM;
- dev_err(&client->dev, "kzalloc() failed\n");
- goto err;
+ goto report_failure;
}

@@ -701,8 +700,9 @@ static int m88rs6000t_probe(struct i2c_client *client,
i2c_set_clientdata(client, dev);
return 0;
err:
- dev_dbg(&client->dev, "failed=%d\n", ret);
kfree(dev);
+report_failure:
+ dev_dbg(&client->dev, "failed=%d\n", ret);
return ret;
}

--
2.14.1
\
 
 \ /
  Last update: 2017-09-16 22:09    [W:0.032 / U:5.556 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site