[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1434630935-4526-1-git-send-email-habdul@visteon.com>
Date: Thu, 18 Jun 2015 12:37:00 +0000
From: "Abdul, Hussain (H.)" <habdul@...teon.com>
To: "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>
CC: "johnny.kim@...el.com" <johnny.kim@...el.com>,
"rachel.kim@...el.com" <rachel.kim@...el.com>,
"dean.lee@...el.com" <dean.lee@...el.com>,
"chris.park@...el.com" <chris.park@...el.com>,
"linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>,
"devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"mravind@...teon.com" <mravind@...teon.com>,
"Dighe, Niranjan (N.)" <ndighe@...teon.com>
Subject: [PATCH] Staging: wilc1000: NULL check before some freeing functions
is not needed
From: Abdul Hussain <habdul@...teon.com>
This patch removes check before freeing the memory
since kfree(NULL) is safe
Signed-off-by: Abdul Hussain <habdul@...teon.com>
---
drivers/staging/wilc1000/linux_wlan_spi.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/wilc1000/linux_wlan_spi.c b/drivers/staging/wilc1000/linux_wlan_spi.c
index 1eee1d5..236669c 100644
--- a/drivers/staging/wilc1000/linux_wlan_spi.c
+++ b/drivers/staging/wilc1000/linux_wlan_spi.c
@@ -214,8 +214,7 @@ int linux_spi_write(uint8_t *b, uint32_t len)
PRINT_ER("SPI transaction failed\n");
}
}
- if (r_buffer)
- kfree(r_buffer);
+ kfree(r_buffer);
} else {
PRINT_ER("can't write data with the following length: %d\n", len);
PRINT_ER("FAILED due to NULL buffer or ZERO length check the following length: %d\n", len);
@@ -377,8 +376,7 @@ int linux_spi_read(unsigned char *rb, unsigned long rlen)
}
}
- if (t_buffer)
- kfree(t_buffer);
+ kfree(t_buffer);
} else {
PRINT_ER("can't read data with the following length: %ld\n", rlen);
ret = -1;
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists