From: YueHaibing Date: Thu, 11 Jul 2019 14:07:26 +0000 (+0800) Subject: staging: kpc2000: kpc_spi: Remove unnecessary null check before kfree X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=d59381d639af22da6eb49c5d851faf15feb6b462;p=linux.git 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 Link: https://lore.kernel.org/r/20190711140726.46732-1-yuehaibing@huawei.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c index 35ac1d7070b38..3be33c450cabb 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); } /******************