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>,
Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 2/2] [media] xc4000: Adjust two null pointer checks in xc4000_fwupload()
Date: Sat, 9 Sep 2017 21:14:47 +0200 [thread overview]
Message-ID: <68444473-5d87-3213-4640-6069c88db1a9@users.sourceforge.net> (raw)
In-Reply-To: <61016489-eb01-2977-b094-343aa70686b0@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 9 Sep 2017 20:55:14 +0200
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The script “checkpatch.pl” pointed information out like the following.
Comparison to NULL could be written !…
Thus fix the affected source code places.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/media/tuners/xc4000.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/media/tuners/xc4000.c b/drivers/media/tuners/xc4000.c
index bbf386127fc4..bd53e44b3cc8 100644
--- a/drivers/media/tuners/xc4000.c
+++ b/drivers/media/tuners/xc4000.c
@@ -775,5 +775,5 @@ static int xc4000_fwupload(struct dvb_frontend *fe)
priv->firm_version >> 8, priv->firm_version & 0xff);
priv->firm = kcalloc(n_array, sizeof(*priv->firm), GFP_KERNEL);
- if (priv->firm == NULL) {
+ if (!priv->firm) {
rc = -ENOMEM;
@@ -821,5 +821,5 @@ static int xc4000_fwupload(struct dvb_frontend *fe)
}
priv->firm[n].ptr = kzalloc(size, GFP_KERNEL);
- if (priv->firm[n].ptr == NULL) {
+ if (!priv->firm[n].ptr) {
rc = -ENOMEM;
--
2.14.1
prev parent reply other threads:[~2017-09-09 19:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-09 19:12 [PATCH 0/2] [media] xc4000: Adjustments for xc4000_fwupload() SF Markus Elfring
2017-09-09 19:13 ` [PATCH 1/2] [media] xc4000: Delete two error messages for a failed memory allocation in xc4000_fwupload() SF Markus Elfring
2017-09-09 19:14 ` SF Markus Elfring [this message]
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=68444473-5d87-3213-4640-6069c88db1a9@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 \
--cc=sakari.ailus@linux.intel.com \
/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®