[patch] ath9k: cleanup: remove unneeded null check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>

Thanks.

Acked-by: Sujith <Sujith.Manoharan@xxxxxxxxxxx>

> 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;
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux