From: Sabitha George <sabitha.george@gmail.com>
To: gregkh@linuxfoundation.org, wsa@the-dreams.de,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Cc: Sabitha George <sabitha.george@gmail.com>
Subject: [PATCH 3/5] staging: ks7010: Remove redundant null pointer check prior to kfree()
Date: Sat, 3 Sep 2016 22:51:11 +0530 [thread overview]
Message-ID: <1472923271-14890-1-git-send-email-sabitha.george@gmail.com> (raw)
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
reply other threads:[~2016-09-03 17:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1472923271-14890-1-git-send-email-sabitha.george@gmail.com \
--to=sabitha.george@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wsa@the-dreams.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome