mwifiex: remove an unneede NULL check in mwifiex_init_adapter()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 23 Mar 2015 09:35:51 +0000 (12:35 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 30 Mar 2015 08:33:42 +0000 (11:33 +0300)
"adapter->sleep_cfm" is always non-NULL at this point.  Static checkers
complain that we already dereference it at the start of the function
when we do:

skb_put(adapter->sleep_cfm, sizeof(struct mwifiex_opt_sleep_confirm));

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/mwifiex/init.c

index 6936de8c8a948ed38bc3d82043ce6db7ddc755cc..e12192f5cfad306b8cd9d4e5fce7ec2bd2e67957 100644 (file)
@@ -266,18 +266,15 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter)
 
        mwifiex_wmm_init(adapter);
 
-       if (adapter->sleep_cfm) {
-               sleep_cfm_buf = (struct mwifiex_opt_sleep_confirm *)
-                                               adapter->sleep_cfm->data;
-               memset(sleep_cfm_buf, 0, adapter->sleep_cfm->len);
-               sleep_cfm_buf->command =
-                               cpu_to_le16(HostCmd_CMD_802_11_PS_MODE_ENH);
-               sleep_cfm_buf->size =
-                               cpu_to_le16(adapter->sleep_cfm->len);
-               sleep_cfm_buf->result = 0;
-               sleep_cfm_buf->action = cpu_to_le16(SLEEP_CONFIRM);
-               sleep_cfm_buf->resp_ctrl = cpu_to_le16(RESP_NEEDED);
-       }
+       sleep_cfm_buf = (struct mwifiex_opt_sleep_confirm *)
+                                       adapter->sleep_cfm->data;
+       memset(sleep_cfm_buf, 0, adapter->sleep_cfm->len);
+       sleep_cfm_buf->command = cpu_to_le16(HostCmd_CMD_802_11_PS_MODE_ENH);
+       sleep_cfm_buf->size = cpu_to_le16(adapter->sleep_cfm->len);
+       sleep_cfm_buf->result = 0;
+       sleep_cfm_buf->action = cpu_to_le16(SLEEP_CONFIRM);
+       sleep_cfm_buf->resp_ctrl = cpu_to_le16(RESP_NEEDED);
+
        memset(&adapter->sleep_params, 0, sizeof(adapter->sleep_params));
        memset(&adapter->sleep_period, 0, sizeof(adapter->sleep_period));
        adapter->tx_lock_flag = false;