From patchwork Tue Feb 13 10:09:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 200336 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp440988dyb; Tue, 13 Feb 2024 02:17:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW+FiQoexYBRKhzVDFQsHHSd9EdyIfrepjQfJu88CObStzJYilqLKgGotvMD09S8NRlehONArXdy+Mr+FhkMvrsm3pr3g== X-Google-Smtp-Source: AGHT+IGwmGdM+GeoNhDgL039o6u8rrA9xq/DXNzR2xdQv47TunH36SqGaXym+oXeKrE4LNMfnN24 X-Received: by 2002:a17:902:ea0d:b0:1d8:fb17:a1fe with SMTP id s13-20020a170902ea0d00b001d8fb17a1femr11341427plg.48.1707819422633; Tue, 13 Feb 2024 02:17:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707819422; cv=pass; d=google.com; s=arc-20160816; b=umXrd/21fPfVcshBUxRaNIqE3CV1QKGIFTm0KjBQaWA6QFF6d7tjOhZ+oJZPKGwidS S4Srl8MiiE4o9ngqsSx2tSAnyf4Z3GXysNBfpXPoh3hah6CsbDy8SDjg4t+tllPric6I vfG3m8leey7oXU7C8wzMBTP4pvfiyp6WmxjkRnQ2pq96+qdA6hx9yqLgi/QjLcpkuw6o yFI3Gqn2VJb396BO8ZjwI5fSHsKryw39XGqPuJxyLUaHcQbSGEXjSEToTUEVkE2WGjZC AIF5LYi9C7S5+ufGhQaHWgX6jupB+lS3+V+25rF1JbhwoUpo0bjseUkAzOUzo0z1j4mo v5LA== 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=eljON3CYp2/c5R6/LEdWLXDR0hjcNwJajagrgZH5nW0=; b=B1MJ+SEpIBJWEuqtm6yHybdHoQzDF4KaKVB6xiP0jghr94a5rd/bHrTT6wiMy8eG41 IpW13Trgyji9ef9ssYdd8/NTcY/c7+imDGGdfaYHGntidyLzZzRdV1fnbzkGRDFQNRJG ++9VVeCT3IVWT0hSpVkzD04Kdbr91OHjeKbklLQt7PBhTmmbgCqekcFrhzlBV2hGPmnz gHrz1T7Hn88kquCA4ynKEIB6+JNvPK8bqbh0+KPbiWsaMzzIRODapAUCg9/DKLicw8tw YGqA6mHOhZfB6akcSGq8nFkxz0/DbS4eninIttUhMM5G/+kxp1tzsQDpH/qSYUWzYfqY 9lAA==; 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-kernel+bounces-63309-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63309-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCVhpLSHzr/MJHsZRhjAR9724SBnxvDKXj6J7+3IgenKTkuZpfTj+u/qA/T9xkKuCLdghwXnbNWxHRJpH0neyyQSoZfg8A== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id y7-20020a17090322c700b001d781dc0f85si1836576plg.352.2024.02.13.02.17.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 02:17:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63309-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; 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-kernel+bounces-63309-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63309-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id B5CBD28276E for ; Tue, 13 Feb 2024 10:09:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C86FA2263A; Tue, 13 Feb 2024 10:09:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="avMTiGFZ" 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790778458551422248 X-GMAIL-MSGID: 1790778458551422248 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; }