From patchwork Sun Jan 24 07:56:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 370083 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E226C433E9 for ; Sun, 24 Jan 2021 07:58:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5067E22CB3 for ; Sun, 24 Jan 2021 07:58:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726482AbhAXH60 (ORCPT ); Sun, 24 Jan 2021 02:58:26 -0500 Received: from smtp03.smtpout.orange.fr ([80.12.242.125]:21152 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726435AbhAXH6Z (ORCPT ); Sun, 24 Jan 2021 02:58:25 -0500 Received: from localhost.localdomain ([92.131.99.25]) by mwinf5d58 with ME id LXwg2400H0Ys01Y03Xwg1N; Sun, 24 Jan 2021 08:56:42 +0100 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 24 Jan 2021 08:56:42 +0100 X-ME-IP: 92.131.99.25 From: Christophe JAILLET To: luciano.coelho@intel.com, kvalo@codeaurora.org, davem@davemloft.net, kuba@kernel.org, mordechay.goodstein@intel.com, johannes.berg@intel.com, sara.sharon@intel.com, nathan.errera@intel.com, Dan1.Halperin@intel.com, emmanuel.grumbach@intel.com, naftali.goldstein@intel.com, netdev@vger.kernel.org Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] iwlwifi: mvm: Fix an error handling path in 'ebu_dma_start()' Date: Sun, 24 Jan 2021 08:56:37 +0100 Message-Id: <20210124075637.732126-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org If the 'cmd_ver' check fails, we must release some memory as already done in all the other error handling paths of this function. Fixes: 9e3c39361a30 ("iwlwifi: mvm: support new KEK KCK api") Signed-off-by: Christophe JAILLET --- drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c index c025188fa9bc..2fb897cbfca6 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c @@ -810,8 +810,10 @@ static int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm, WOWLAN_KEK_KCK_MATERIAL, IWL_FW_CMD_VER_UNKNOWN); if (WARN_ON(cmd_ver != 2 && cmd_ver != 3 && - cmd_ver != IWL_FW_CMD_VER_UNKNOWN)) - return -EINVAL; + cmd_ver != IWL_FW_CMD_VER_UNKNOWN)) { + ret = -EINVAL; + goto out; + } if (cmd_ver == 3) cmd_size = sizeof(struct iwl_wowlan_kek_kck_material_cmd_v3); else