aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/kpc2000
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2019-07-11 22:07:26 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-07-22 07:34:13 +0200
commitd59381d639af22da6eb49c5d851faf15feb6b462 (patch)
treef410110b51579d5be3e524d92e494eb702c54a29 /drivers/staging/kpc2000
parentstaging: rtl8188eu: remove unused definitions from hal8188e_phy_reg.h (diff)
downloadlinux-dev-d59381d639af22da6eb49c5d851faf15feb6b462.tar.xz
linux-dev-d59381d639af22da6eb49c5d851faf15feb6b462.zip
staging: kpc2000: kpc_spi: Remove unnecessary null check before kfree
A null check before a kfree is redundant, so remove it. This is detected by coccinelle. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20190711140726.46732-1-yuehaibing@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/kpc2000')
-rw-r--r--drivers/staging/kpc2000/kpc2000_spi.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c
index 35ac1d7070b3..3be33c450cab 100644
--- a/drivers/staging/kpc2000/kpc2000_spi.c
+++ b/drivers/staging/kpc2000/kpc2000_spi.c
@@ -412,8 +412,7 @@ kp_spi_cleanup(struct spi_device *spidev)
{
struct kp_spi_controller_state *cs = spidev->controller_state;
- if (cs)
- kfree(cs);
+ kfree(cs);
}
/******************