* [patch 2/4] mwifiex: remove an unneeded NULL check
@ 2011-10-18 6:14 Dan Carpenter
2011-10-18 17:59 ` Bing Zhao
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2011-10-18 6:14 UTC (permalink / raw)
To: Bing Zhao; +Cc: John W. Linville, linux-wireless, kernel-janitors
We dereference adapter in the error handling code so this needed to
be fixed. This function is always called like:
adapter->if_ops.host_to_card(adapter, ...);
so adapter can never be NULL and I've removed the NULL check.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c
index 4466976..d12d440 100644
--- a/drivers/net/wireless/mwifiex/pcie.c
+++ b/drivers/net/wireless/mwifiex/pcie.c
@@ -1671,9 +1671,8 @@ static int mwifiex_pcie_host_to_card(struct mwifiex_adapter *adapter, u8 type,
struct sk_buff *skb,
struct mwifiex_tx_param *tx_param)
{
- if (!adapter || !skb) {
- dev_err(adapter->dev, "Invalid parameter in %s <%p, %p>\n",
- __func__, adapter, skb);
+ if (!skb) {
+ dev_err(adapter->dev, "Passed NULL skb to %s\n", __func__);
return -1;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [patch 2/4] mwifiex: remove an unneeded NULL check
2011-10-18 6:14 [patch 2/4] mwifiex: remove an unneeded NULL check Dan Carpenter
@ 2011-10-18 17:59 ` Bing Zhao
0 siblings, 0 replies; 2+ messages in thread
From: Bing Zhao @ 2011-10-18 17:59 UTC (permalink / raw)
To: Dan Carpenter
Cc: John W. Linville, linux-wireless@vger.kernel.org,
kernel-janitors@vger.kernel.org
> -----Original Message-----
> From: Dan Carpenter [mailto:dan.carpenter@oracle.com]
> Sent: Monday, October 17, 2011 11:14 PM
> To: Bing Zhao
> Cc: John W. Linville; linux-wireless@vger.kernel.org; kernel-janitors@vger.kernel.org
> Subject: [patch 2/4] mwifiex: remove an unneeded NULL check
>
> We dereference adapter in the error handling code so this needed to
> be fixed. This function is always called like:
> adapter->if_ops.host_to_card(adapter, ...);
> so adapter can never be NULL and I've removed the NULL check.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Bing Zhao <bzhao@marvell.com>
Thanks,
Bing
>
> diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c
> index 4466976..d12d440 100644
> --- a/drivers/net/wireless/mwifiex/pcie.c
> +++ b/drivers/net/wireless/mwifiex/pcie.c
> @@ -1671,9 +1671,8 @@ static int mwifiex_pcie_host_to_card(struct mwifiex_adapter *adapter, u8 type,
> struct sk_buff *skb,
> struct mwifiex_tx_param *tx_param)
> {
> - if (!adapter || !skb) {
> - dev_err(adapter->dev, "Invalid parameter in %s <%p, %p>\n",
> - __func__, adapter, skb);
> + if (!skb) {
> + dev_err(adapter->dev, "Passed NULL skb to %s\n", __func__);
> return -1;
> }
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-10-18 17:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-18 6:14 [patch 2/4] mwifiex: remove an unneeded NULL check Dan Carpenter
2011-10-18 17:59 ` Bing Zhao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox