From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-media@vger.kernel.org, Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 1/2] [media] tuners: Delete an error message for a failed memory allocation in m88rs6000t_probe()
Date: Sat, 16 Sep 2017 22:08:33 +0200 [thread overview]
Message-ID: <feb744ef-7f3f-5005-f208-bd1385678592@users.sourceforge.net> (raw)
In-Reply-To: <278b14e0-f717-7471-6dc3-45dc98d64443@users.sourceforge.net>
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
next prev parent reply other threads:[~2017-09-16 20:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-16 20:07 [PATCH 0/2] [media] M88RS6000T: Adjustments for two function implementations SF Markus Elfring
2017-09-16 20:08 ` SF Markus Elfring [this message]
2017-09-16 20:10 ` [PATCH 2/2] [media] m88rs6000t: Improve three size determinations SF Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=feb744ef-7f3f-5005-f208-bd1385678592@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®