linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] ath9k: cleanup: remove unneeded null check
@ 2010-05-22 20:33 Dan Carpenter
  2010-05-24  4:14 ` Sujith
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-05-22 20:33 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Jouni Malinen, Sujith Manoharan, Vasanthakumar Thiagarajan,
	Senthil Balasubramanian, John W. Linville, Ming Lei,
	linux-wireless, ath9k-devel, kernel-janitors

We dereference "wmi" on the line before and also when we initialize "ah".
This check has always been after a dereference since the first commit a
couple months ago.  Looking through the code, it looks like "wmi" can't 
actually be null here so I just removed the check.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/net/wireless/ath/ath9k/wmi.c b/drivers/net/wireless/ath/ath9k/wmi.c
index e23172c..6260faa 100644
--- a/drivers/net/wireless/ath/ath9k/wmi.c
+++ b/drivers/net/wireless/ath/ath9k/wmi.c
@@ -279,9 +279,6 @@ int ath9k_wmi_cmd(struct wmi *wmi, enum wmi_cmd_id cmd_id,
 	if (wmi->drv_priv->op_flags & OP_UNPLUGGED)
 		return 0;
 
-	if (!wmi)
-		return -EINVAL;
-
 	skb = alloc_skb(headroom + cmd_len, GFP_ATOMIC);
 	if (!skb)
 		return -ENOMEM;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [patch] ath9k: cleanup: remove unneeded null check
  2010-05-22 20:33 [patch] ath9k: cleanup: remove unneeded null check Dan Carpenter
@ 2010-05-24  4:14 ` Sujith
  0 siblings, 0 replies; 2+ messages in thread
From: Sujith @ 2010-05-24  4:14 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Luis Rodriguez, Jouni Malinen, Vasanth Thiagarajan,
	Senthilkumar Balasubramanian, John W. Linville, Ming Lei,
	linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org,
	kernel-janitors@vger.kernel.org

Dan Carpenter wrote:
> We dereference "wmi" on the line before and also when we initialize "ah".
> This check has always been after a dereference since the first commit a
> couple months ago.  Looking through the code, it looks like "wmi" can't 
> actually be null here so I just removed the check.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Thanks.

Acked-by: Sujith <Sujith.Manoharan@atheros.com>

> diff --git a/drivers/net/wireless/ath/ath9k/wmi.c b/drivers/net/wireless/ath/ath9k/wmi.c
> index e23172c..6260faa 100644
> --- a/drivers/net/wireless/ath/ath9k/wmi.c
> +++ b/drivers/net/wireless/ath/ath9k/wmi.c
> @@ -279,9 +279,6 @@ int ath9k_wmi_cmd(struct wmi *wmi, enum wmi_cmd_id cmd_id,
>  	if (wmi->drv_priv->op_flags & OP_UNPLUGGED)
>  		return 0;
>  
> -	if (!wmi)
> -		return -EINVAL;
> -
>  	skb = alloc_skb(headroom + cmd_len, GFP_ATOMIC);
>  	if (!skb)
>  		return -ENOMEM;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-05-24  4:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-22 20:33 [patch] ath9k: cleanup: remove unneeded null check Dan Carpenter
2010-05-24  4:14 ` Sujith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).