From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxxxx> --- 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