mwifiex: change debug dump issue since skb maybe null
authorZhaoyang Liu <liuzy@marvell.com>
Thu, 4 Jun 2015 19:31:53 +0000 (01:01 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 8 Jun 2015 08:49:45 +0000 (11:49 +0300)
This patch fixes semantic warning for debugging data dump feature.
Previous code is based on the assumption that skb is not null.
New change makes sure that we already have data buffer.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Zhaoyang Liu <liuzy@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/mwifiex/cmdevt.c

index a51feac6bd36242a8298dda9898e13a65d661318..207da40500f4309fcdd0405e99365f4aa274f502 100644 (file)
@@ -469,10 +469,11 @@ int mwifiex_process_event(struct mwifiex_adapter *adapter)
                memset(rx_info, 0, sizeof(*rx_info));
                rx_info->bss_num = priv->bss_num;
                rx_info->bss_type = priv->bss_type;
+               mwifiex_dbg_dump(adapter, EVT_D, "Event Buf:",
+                                skb->data, skb->len);
        }
 
        mwifiex_dbg(adapter, EVENT, "EVENT: cause: %#x\n", eventcause);
-       mwifiex_dbg_dump(adapter, EVT_D, "Event Buf:", skb->data, skb->len);
 
        if (priv->bss_role == MWIFIEX_BSS_ROLE_UAP)
                ret = mwifiex_process_uap_event(priv);