[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20190718182250.GA3011@hari-Inspiron-1545>
Date: Thu, 18 Jul 2019 23:52:50 +0530
From: Hariprasad Kelam <hariprasad.kelam@...il.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Geordan Neukum <gneukum1@...il.com>,
Dan Carpenter <dan.carpenter@...cle.com>,
Michael Scheiderer <michael.scheiderer@....de>,
Fabian Krueger <fabian.krueger@....de>,
Simon Sandström <simon@...anor.nu>,
Jeremy Sowden <jeremy@...zel.net>, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] staging: kpc2000: Remove null check before kfree
As kfree already has NULL check we may not need null check before
calling same.
Issue found with coccicheck
Signed-off-by: Hariprasad Kelam <hariprasad.kelam@...il.com>
---
drivers/staging/kpc2000/kpc2000_spi.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c
index 35ac1d7..c07d2fc 100644
--- a/drivers/staging/kpc2000/kpc2000_spi.c
+++ b/drivers/staging/kpc2000/kpc2000_spi.c
@@ -411,9 +411,7 @@ kp_spi_transfer_one_message(struct spi_master *master, struct spi_message *m)
kp_spi_cleanup(struct spi_device *spidev)
{
struct kp_spi_controller_state *cs = spidev->controller_state;
-
- if (cs)
- kfree(cs);
+ kfree(cs);
}
/******************
--
2.7.4
Powered by blists - more mailing lists