Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1356388lqo; Sat, 11 May 2024 21:32:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXKgrTZp350J2A9+ZY7qfILuD9Q6SvtGDqdutlLeEpWGcAi3MattYggQNOb+R4+60bsbsiwKlpVi7nWcTXdN7EhCj1/hcS1g7hp/Cag4g== X-Google-Smtp-Source: AGHT+IG6P693HW6Xn8t8DIWk+zw/p+gZLJ3hLXufQWttUh/DYWlyEQMUFptQ83kWPvs26uwAJFNw X-Received: by 2002:a05:6214:5542:b0:6a0:cda8:ffba with SMTP id 6a1803df08f44-6a1681badb5mr79278066d6.36.1715488327179; Sat, 11 May 2024 21:32:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715488327; cv=pass; d=google.com; s=arc-20160816; b=L4ySN7zhqiACCnltYLFJvxcyZgVKntNS7bFUe4cKRT4gTW+wBR3N+BZ6+LWSYnD0Pb hwb8/IgXnG4n5uD6bybckdInRHNsFT1stgbpz6Dp7ACbVH5V/6a6NDDyOTua7U4oP7gj /R4jFMxdTJ15yVbW6otEY6PUOsbCLqdhfOsM63dICbp8NkhAKRZIFtUgidBnbFLna9mN CF+npt1uu0pMxanCgV8eSHka+KWqGK9dWNlqWcCMv/Z/oidTq8SF2QGvpRh4fqYCrp/y YK15+I29ZnZX2fzjPLmaFuuNY8566YD7ble24fQpiMnNMsz4EAd28E5CPJaeEIAwgpvQ 8rpQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:organization:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=23+0l//41lEkzi3TGtj28g7oEcyu18rBuvPZtb0den0=; fh=TquNsOiV+zNY1csTpltVB6A9QFW5SbuNs6JlqcKCQkw=; b=t2CgyQEhM3aoLpWcs3SFK0UWAGZiUI13r8ltlZqgib6+iYgUG7ukIzTtSdKrPWrl07 QTltEc30zbvp1XxfrF/ro8oF9kwR7Tl8xCd2SardPX7VZhBbYc+/Twt/qQxfqpwspV1i 4wZPkMApAiXYakuw8rJaV3jakceDQ0CpY9WrBzD6I0txVVkClHRDGJ4IRoADc1LjE0Cs hKuviBUO6WSXuYNHUu6tG0Lb3hirvcLfvFL04xf9MFTjesPLP/J14faXmrljgrpEMP0I SFAKjhFGGLDZKuJ9uJ8u7PTGD071S+Z69qDB+oVHozmjKRDEQOIBiaSOWibEWpcJli8X q4GQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gx8VwZue; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-wireless+bounces-7520-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7520-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6a15f29a520si69495376d6.297.2024.05.11.21.32.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 May 2024 21:32:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-7520-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gx8VwZue; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-wireless+bounces-7520-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7520-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E20141C20C33 for ; Sun, 12 May 2024 04:32:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 40E5B1B299; Sun, 12 May 2024 04:31:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="gx8VwZue" X-Original-To: linux-wireless@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B622518040 for ; Sun, 12 May 2024 04:31:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715488299; cv=none; b=CGZlqNxCpRahkJroHLxFWVQH+YuT2OSNNx6uAwf9Ke16Pmdj8fK4+G5924qLrd6GWKasx6yExt2kMfRPrXCpC7wThky9xlAZAH0sQXKCD/x/3wz8Dh2CCz6CueY+xIsqtKaPoDAKcZEDxiCjD7ysfABAwVeXsdsMENURwizlpLY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715488299; c=relaxed/simple; bh=02xpOPIxUWrmTGm+MwU8U5S4B5509jNsZb2bclQsBfM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=C745GhJ7cEL2fzU2oWQHtVCFfks4ivBMSurU9I5dBaAPN+HmcOmVPlJhxsyMNOM6IvsUQVc0wlVXTr0ZtDVbaC/XLBr7Pacq7lxstvKSACnsS+QrtflroIG9epA8k3f48ylS5DMT6Gmn8eazGx6cRbrgufNLJLNa175czjnqzDk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=gx8VwZue; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715488298; x=1747024298; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=02xpOPIxUWrmTGm+MwU8U5S4B5509jNsZb2bclQsBfM=; b=gx8VwZueX1p/0JjVInc11hwwlBsjmY3P8v1sQupsZUoVs8MJQ4O4Vcua xN3Zo4Z4GyT2Pb9xwW3HQ91qsfTMYFxjwW+FMinSSNCIVplFbZyOa9rGJ qyIiWbZSADZp8GvwJQXj9zILSUNexLefE4Qg8RUxLntZAR/idJGZD0O9s hdoNYqCvOsnpzwltA+lHdiOuPPCnAt9lTyFBBxydYcrlPYstqgo5P3EvR Az3HYexV2l628TaYSbByaJa4rpAAS/SyGRnleiqyDQxnfjURs6AIalJfy 7O5V4kFdkMgQ2DOYLx1wytxjr+cId2b/73Lu4xe7/VPH1YB9HcIuBl5Y9 Q==; X-CSE-ConnectionGUID: P7Gcv1KRRtC9DyiJp4y2NA== X-CSE-MsgGUID: /DN4BH9hTmGSiwtHLZ25vw== X-IronPort-AV: E=McAfee;i="6600,9927,11070"; a="11323854" X-IronPort-AV: E=Sophos;i="6.08,155,1712646000"; d="scan'208";a="11323854" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2024 21:31:37 -0700 X-CSE-ConnectionGUID: jXMqOGi1QoSKiLPYVDZ6mg== X-CSE-MsgGUID: 2yQRSPriSy+TkeSJXNcvfA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,155,1712646000"; d="scan'208";a="34532166" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2024 21:31:36 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 09/16] wifi: iwlwifi: fw: avoid bad FW config on RXQ DMA failure Date: Sun, 12 May 2024 07:31:03 +0300 Message-Id: <20240512072733.faf3a1b87589.I77c950173cb914676fbd28483e5ef420bb9f1bc9@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240512043110.3413383-1-miriam.rachel.korenblit@intel.com> References: <20240512043110.3413383-1-miriam.rachel.korenblit@intel.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Israel (74) Limited Content-Transfer-Encoding: 8bit From: Johannes Berg In practice, iwl_trans_get_rxq_dma_data() will not fail, it only can do that if called with the wrong arguments. But it does have an error value and doesn't initialize the argument when it fails, so don't use the value then. Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/fw/init.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/init.c b/drivers/net/wireless/intel/iwlwifi/fw/init.c index 135bd48bfe9f..d8b083be5b6b 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/init.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/init.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause /* * Copyright (C) 2017 Intel Deutschland GmbH - * Copyright (C) 2019-2021 Intel Corporation + * Copyright (C) 2019-2021, 2024 Intel Corporation */ #include "iwl-drv.h" #include "runtime.h" @@ -135,7 +135,9 @@ int iwl_configure_rxq(struct iwl_fw_runtime *fwrt) struct iwl_trans_rxq_dma_data data; cmd->data[i].q_num = i + 1; - iwl_trans_get_rxq_dma_data(fwrt->trans, i + 1, &data); + ret = iwl_trans_get_rxq_dma_data(fwrt->trans, i + 1, &data); + if (ret) + goto out; cmd->data[i].fr_bd_cb = cpu_to_le64(data.fr_bd_cb); cmd->data[i].urbd_stts_wrptr = @@ -149,6 +151,7 @@ int iwl_configure_rxq(struct iwl_fw_runtime *fwrt) ret = iwl_trans_send_cmd(fwrt->trans, &hcmd); +out: kfree(cmd); if (ret) -- 2.34.1