From patchwork Mon Nov 24 14:34:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emmanuel Grumbach X-Patchwork-Id: 5367061 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 85530C11AC for ; Mon, 24 Nov 2014 14:36:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B14542041D for ; Mon, 24 Nov 2014 14:36:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DFA8A2041C for ; Mon, 24 Nov 2014 14:36:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932290AbaKXOg0 (ORCPT ); Mon, 24 Nov 2014 09:36:26 -0500 Received: from mail-wi0-f169.google.com ([209.85.212.169]:32851 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932285AbaKXOgZ (ORCPT ); Mon, 24 Nov 2014 09:36:25 -0500 Received: by mail-wi0-f169.google.com with SMTP id r20so9204269wiv.0 for ; Mon, 24 Nov 2014 06:36:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BbMx3WR/jyNldbSF922A1EYMyTwByUb5AiYJ4dCX3bw=; b=RWbZ5MeVgECusmBePQ3phS/4ztqg+quEoUPkOdn04iDW8uNx6ThBg+Yfoj+qbBrhHW GpzOHJhtMBIZ7IPSZL1LuZhsba8M7H+STWnhCBBxzNrOz8GSGqS0mI5KHhob1fKe7Qk9 2HqWlsNVf5VzuC0lARolgU3dyfYgnsj9A0ukt6HZR7Rh4FV7OSVIgmBQ6aphyNzqWPgh hDWEDdY3FK6ccfYJlio/dfEt3HWLYDbxwXKtupkydWZrbHWI27bqjM50FuG96wrJ1t+0 fPpcBjDL8Oq30vWuMqgy7XYRqf7Ie6ZUg2oZ+sMMaJVkvqqm1LwYT68ZWc0o5zq6oRWf aitg== X-Received: by 10.180.20.163 with SMTP id o3mr22940232wie.12.1416839783988; Mon, 24 Nov 2014 06:36:23 -0800 (PST) Received: from localhost.localdomain (46-116-150-134.bb.netvision.net.il. [46.116.150.134]) by mx.google.com with ESMTPSA id n3sm21274744wjz.21.2014.11.24.06.36.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Nov 2014 06:36:23 -0800 (PST) From: Emmanuel Grumbach To: linux-wireless@vger.kernel.org Cc: Luciano Coelho Subject: [PATCH 53/75] iwlwifi: mvm: return the actual error code when switch_vif_chanctx fails Date: Mon, 24 Nov 2014 16:34:29 +0200 Message-Id: <1416839691-28533-53-git-send-email-egrumbach@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Luciano Coelho We have code to recover and go back to the original channel context if something fails in the middle of switch_vif_chanctx, but we return the error code of the recover calls instead of the original code, so if the recovery succeeds, we will return 0 (success). Fix this by not assigning the return value of the recovery calls to ret. Signed-off-by: Luciano Coelho --- drivers/net/wireless/iwlwifi/mvm/mac80211.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c index 542e59f..1d55617 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c @@ -2988,15 +2988,13 @@ out_remove: __iwl_mvm_remove_chanctx(mvm, vifs[0].new_ctx); out_reassign: - ret = __iwl_mvm_add_chanctx(mvm, vifs[0].old_ctx); - if (ret) { + if (__iwl_mvm_add_chanctx(mvm, vifs[0].old_ctx)) { IWL_ERR(mvm, "failed to add old_ctx back after failure.\n"); goto out_restart; } - ret = __iwl_mvm_assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].old_ctx, - true); - if (ret) { + if (__iwl_mvm_assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].old_ctx, + true)) { IWL_ERR(mvm, "failed to reassign old_ctx after failure.\n"); goto out_restart; }