Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2950217rdb; Tue, 13 Feb 2024 02:09:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVf0g5H31Y9Z2XuQtZ1sGWizF6Ok409H3eSx53tNAM4betFb3zZYVTNgk3fCD0r4WQxeNkkig6Bhk+0iwuANlwHhkXw9dcdr5k8FtV2mA== X-Google-Smtp-Source: AGHT+IGRoCLewMtLIEpiGdTWFA/mrdsfGZLch96A+8EqGXU7Y2Rk0UYJhYaUTDD+lVKL1onZQO2L X-Received: by 2002:ae9:e316:0:b0:787:2017:21b2 with SMTP id v22-20020ae9e316000000b00787201721b2mr649157qkf.70.1707818959503; Tue, 13 Feb 2024 02:09:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707818959; cv=pass; d=google.com; s=arc-20160816; b=06EJUtF1EsJPTYW/C1Lx0pbaBaPaaTdZuT7NbW5/5GMj1e5mUGVWzjbDGRK4jFXxkt Uq+HsAjqUbSEn/Agx5BwLU5vykwlWst2YT85Ugt9tT3qItBcJSXkjhbDiHFGZ41RhCxW /LMZgF9Y/iGbMzroOV/bMCn3Sb1H6MKHCGxv3vI4w7XmJ2sFpyRXIVf7aOie5Mb418uj nrW7SGfkaxEQSqkenT/ZHcJVnv6PTI/JFJbLocFFkSFOG7EPEzuDDGS1K4YGQ/SwGAc/ w+pvKgo3yEsJRxrtND82oLZxXVADwO0scqTgSA9vSKHjHxlQ9UxvBhTJ6pf7QxhlZB/c pjAw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=SLJ/e62z5keo5AIeGYTm1RDAscuZBgXO/Z+69iU/PvY=; fh=PU25RIBG+Acf+jlQTeh+VGzx7+XEnYdIBpzXTBzezlU=; b=C16SDS1O+EfuHzO1iuKN912vrh+d1+DAlnEDx/vP41Navc+Wp5OfF88Uc1K6AKUkWq 1N0iA84/kV5NezEAUJc6/9+FEcnhydFEkhnUJzYwEBsH+VWZTcDk84nlLozNREnfTHe3 Tzzdy0CiyHz5E/uVSx4PqKHBOC4GrcbDSGZ+0nTPKlIzWQzv4x7UWQJrhcYnq18IMbYV YZDY+VeIXS2y0OuMlM2Ket4sfWrWiNp6Vsvcenf9w5xu/IxqpXwiy9fqsaaRFieRgOtk eXt9H+OIgswuOhDCJo+klIsRW2zzofugxMkkbbuG90cHsu6xhWG9GHkbgK220nBafDDw hdJQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=avMTiGFZ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-3521-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3521-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCWjK15kQ8bKaxVhdC8Dnnf5LR0j8cDZJyxa5qA9ezGjvbLmge6kcFxVdPQGKvnm6U2JZRyVKwExO8B7gKsWe9cr4M7CwWqzTw5yQrfhRA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id br17-20020a05620a461100b007871d41a880si934694qkb.644.2024.02.13.02.09.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 02:09:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3521-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=avMTiGFZ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-3521-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3521-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 415FF1C2039A for ; Tue, 13 Feb 2024 10:09:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3057D224F9; Tue, 13 Feb 2024 10:09:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="avMTiGFZ" X-Original-To: linux-wireless@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 062CB224E6; Tue, 13 Feb 2024 10:09:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707818958; cv=none; b=qWZHefZhXDXhtdnlJ9jxGYvwzYmKPBT5iZLxq7gcnXHKHeS0Oetixd4VR6+8xJbL+GlE8eas4Xum9sdk2AA+vtnnu9fGER40BxRZuTQ1jhgjVfKt4ZjP11WY5MqUj3cHcvpGqlkjANCyB0KgXGbKh/Mju2wSKddMsYpbDg+duS4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707818958; c=relaxed/simple; bh=HiQZbdRmzgTCB8ES0rsIWJhMeBxKcVI2EgJVFYK5Yf8=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Vwpa1e2JML2XyuHmQIxCCMpvZRU+Uc76JZ3sZ8xD1B3LX/GISXW3hkz49LiqCoRvcxxvOQq+dui0yNEBE3D8N0Cv76KgB3bjH4Tf8sUP/j0vtkuEX73egngTXERSdS8Gy8qG56kINlClBtZ0rQBPdQ3h3hXiT34lGGPFontS/Co= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=avMTiGFZ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C174C433C7; Tue, 13 Feb 2024 10:09:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707818957; bh=HiQZbdRmzgTCB8ES0rsIWJhMeBxKcVI2EgJVFYK5Yf8=; h=From:To:Cc:Subject:Date:From; b=avMTiGFZmj1wjnBPK3XnQaqWfS/7+BbASpyxX5lpSUDuWS63seveFw96r/Qvfst+f bnU4gUmidsQcnjDMw1d/JdNBasC3KdDdQkfFd4wibVtwyOJAeaPoCWA3YFays2zQeZ ZVIYqXZ5XbjcI1Y2tHw+SPOB8C5PfQpLG89+i/DaGw4bx6XjZyXhIZlfhe5nAWXUrm iDnYF24eCvShjvczrifMxhg+rgAeQa0IMkbyX9DQs5EUPGZW6xabDNig4x3Ee6YVba doJeEel5bUec3/Q4lQctn51QyUSmvnYDOuquxep9qnEP5IQpyN7jAnby6eoaFfZCLO MyLifuYmoDJdw== From: Arnd Bergmann To: Kalle Valo , Jeff Johnson , Karthikeyan Periyasamy Cc: Arnd Bergmann , Aloka Dixit , Wen Gong , Muna Sinada , Aditya Kumar Singh , ath12k@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] wifi: ath12k: sanitize ath12k_mac_allocate() return code Date: Tue, 13 Feb 2024 11:09:06 +0100 Message-Id: <20240213100912.459018-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Arnd Bergmann The return code has no initializer: drivers/net/wireless/ath/ath12k/mac.c:8006:9: error: variable 'ret' is uninitialized when used here [-Werror,-Wuninitialized] Make it return -ENOMEM for allocation failures and remove the unused variable instead. Fixes: 6db6e70a17f6 ("wifi: ath12k: Introduce the container for mac80211 hw") Signed-off-by: Arnd Bergmann --- drivers/net/wireless/ath/ath12k/mac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index f2f7b2a60261..e93475ae8d07 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -7965,7 +7965,7 @@ int ath12k_mac_allocate(struct ath12k_base *ab) { struct ath12k_hw *ah; struct ath12k_pdev_map pdev_map[MAX_RADIOS]; - int ret, i, j; + int i, j; u8 radio_per_hw; if (test_bit(ATH12K_FLAG_REGISTERED, &ab->dev_flags)) @@ -8003,5 +8003,5 @@ int ath12k_mac_allocate(struct ath12k_base *ab) ab->ah[i] = NULL; } - return ret; + return -ENOMEM; } -- 2.39.2