From: Dan Carpenter Date: Fri, 4 Dec 2015 13:16:45 +0000 (+0300) Subject: iwlegacy: cleanup end of il_send_add_sta() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3f0267f6f76d56285095f88a8908daf8be0fe56b;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git iwlegacy: cleanup end of il_send_add_sta() 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 Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo --- diff --git a/drivers/net/wireless/intel/iwlegacy/common.c b/drivers/net/wireless/intel/iwlegacy/common.c index 887114582583..e49bad261a76 100644 --- a/drivers/net/wireless/intel/iwlegacy/common.c +++ b/drivers/net/wireless/intel/iwlegacy/common.c @@ -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;