Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1475765
| From | Sabitha George <sabitha.george@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 3/5] staging: ks7010: Remove redundant null pointer check prior to kfree() |
| Date | 2016-09-03 19:40 +0200 |
| Message-ID | <sdn58-8f6-11@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
This patch fixes the warning on ks7010_sdio.c :'kfree(NULL) is safe and this check is probably not required' Signed-off-by: Sabitha George <sabitha.george@gmail.com> --- drivers/staging/ks7010/ks7010_sdio.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c index b16286e..67b01a6 100644 --- a/drivers/staging/ks7010/ks7010_sdio.c +++ b/drivers/staging/ks7010/ks7010_sdio.c @@ -716,8 +716,7 @@ static int ks7010_sdio_update_index(struct ks_wlan_private *priv, u32 index) goto error_out; } error_out: - if (data_buf) - kfree(data_buf); + kfree(data_buf); return rc; } @@ -747,8 +746,7 @@ static int ks7010_sdio_data_compare(struct ks_wlan_private *priv, u32 address, goto error_out; } error_out: - if (read_buf) - kfree(read_buf); + kfree(read_buf); return rc; } @@ -863,8 +861,7 @@ static int ks7010_upload_firmware(struct ks_wlan_private *priv, release_firmware(fw_entry); error_out0: sdio_release_host(card->func); - if (rom_buf) - kfree(rom_buf); + kfree(rom_buf); return rc; } @@ -1182,8 +1179,7 @@ static void ks7010_sdio_remove(struct sdio_func *func) unregister_netdev(netdev); trx_device_exit(priv); - if (priv->ks_wlan_hw.read_buf) - kfree(priv->ks_wlan_hw.read_buf); + kfree(priv->ks_wlan_hw.read_buf); free_netdev(priv->net_dev); card->priv = NULL; -- 1.9.1
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 3/5] staging: ks7010: Remove redundant null pointer check prior to kfree() Sabitha George <sabitha.george@gmail.com> - 2016-09-03 19:40 +0200
csiph-web