From: SF Markus Elfring Date: Sat, 09 Sep 2017 19:14:47 +0000 Subject: [PATCH 2/2] [media] xc4000: Adjust two null pointer checks in xc4000_fwupload() Message-Id: <68444473-5d87-3213-4640-6069c88db1a9@users.sourceforge.net> List-Id: References: <61016489-eb01-2977-b094-343aa70686b0@users.sourceforge.net> In-Reply-To: <61016489-eb01-2977-b094-343aa70686b0@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: linux-media@vger.kernel.org, Mauro Carvalho Chehab , Max Kellermann , Sakari Ailus Cc: LKML , kernel-janitors@vger.kernel.org From: Markus Elfring 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 --- 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