iwlegacy: cleanup end of il_send_add_sta()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 4 Dec 2015 13:16:45 +0000 (16:16 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 11 Dec 2015 11:15:49 +0000 (13:15 +0200)
This code causes a static checker warning because we check for
"if (ret == 0)" but we have already had verified that was true.  Clean
it up a little.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/intel/iwlegacy/common.c

index 887114582583b2e477cdad704b99f3a6e64bc742..e49bad261a76d7b38bfcd111cce2ba6e99b25c39 100644 (file)
@@ -1865,14 +1865,14 @@ il_send_add_sta(struct il_priv *il, struct il_addsta_cmd *sta, u8 flags)
 
        cmd.len = il->ops->build_addsta_hcmd(sta, data);
        ret = il_send_cmd(il, &cmd);
-
-       if (ret || (flags & CMD_ASYNC))
+       if (ret)
                return ret;
+       if (flags & CMD_ASYNC)
+               return 0;
+
+       pkt = (struct il_rx_pkt *)cmd.reply_page;
+       ret = il_process_add_sta_resp(il, sta, pkt, true);
 
-       if (ret == 0) {
-               pkt = (struct il_rx_pkt *)cmd.reply_page;
-               ret = il_process_add_sta_resp(il, sta, pkt, true);
-       }
        il_free_pages(il, cmd.reply_page);
 
        return ret;