mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-media@vger.kernel.org,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Max Kellermann <max.kellermann@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 1/4] [media] ds3000: Delete an error message for a failed memory allocation in two functions
Date: Wed, 30 Aug 2017 22:21:13 +0200	[thread overview]
Message-ID: <3f061ac7-4738-ec12-3f4b-dca8c2b6eba5@users.sourceforge.net> (raw)
In-Reply-To: <c854b845-3b79-ca7a-a597-4abc5f32ec54@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 30 Aug 2017 21:41:28 +0200

Omit an extra message for a memory allocation failure in these functions.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/media/dvb-frontends/ds3000.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/media/dvb-frontends/ds3000.c b/drivers/media/dvb-frontends/ds3000.c
index 0b17a45c5640..c2959a9695a7 100644
--- a/drivers/media/dvb-frontends/ds3000.c
+++ b/drivers/media/dvb-frontends/ds3000.c
@@ -280,7 +280,5 @@ static int ds3000_writeFW(struct ds3000_state *state, int reg,
-	if (buf == NULL) {
-		printk(KERN_ERR "Unable to kmalloc\n");
+	if (!buf)
 		return -ENOMEM;
-	}
 
 	*(buf) = reg;
 
@@ -845,7 +843,5 @@ struct dvb_frontend *ds3000_attach(const struct ds3000_config *config,
-	if (state == NULL) {
-		printk(KERN_ERR "Unable to kmalloc\n");
+	if (!state)
 		goto error2;
-	}
 
 	state->config = config;
 	state->i2c = i2c;
-- 
2.14.1

  reply	other threads:[~2017-08-30 20:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-30 20:20 [PATCH 0/4] [media] ds3000: Adjustments for two function implementations SF Markus Elfring
2017-08-30 20:21 ` SF Markus Elfring [this message]
2017-08-30 20:22 ` [PATCH 2/4] [media] ds3000: Improve a size determination in ds3000_attach() SF Markus Elfring
2017-08-30 20:23 ` [PATCH 3/4] [media] ds3000: Delete an unnecessary variable initialisation " SF Markus Elfring
2017-08-30 20:24 ` [PATCH 4/4] [media] ds3000: Delete jump targets " 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=3f061ac7-4738-ec12-3f4b-dca8c2b6eba5@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=max.kellermann@gmail.com \
    --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

Powered by JetHome