Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp2677476ybn; Thu, 26 Sep 2019 15:59:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqwC2ceOupWudn8robREJQJKAi93S7dyqtA+U+9pK1DEzRCotOG80cIKx9x1C8BtybOZsT0+ X-Received: by 2002:aa7:d48f:: with SMTP id b15mr1362737edr.159.1569538763822; Thu, 26 Sep 2019 15:59:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569538763; cv=none; d=google.com; s=arc-20160816; b=tvbshlKqmEaPvzpeE2BKenvAQrvHgFSRmQUJoDxzSPIY70xElceCmundLd/US9TLYo /p/KvmI5QAyPBxRwrVJOIUxvc+fAlkB3et2LzSklxOJ+CUB/ABXmLjUMF++7Zem1c7/S DoEsoY0mlW8kJEONxQaZzlaM0KHiillOJN/wHn4KuG/SU+2EAoGBS4WlYd8OWMM2M/Dm Sw/5IKYcy+49VjFYJJdbmt86o+bOX4ZYZ5AW1cUOu/64Q9hEtLMsmvNnfQd6yUOPfnXI uLGif0z+TBdL0cwzgN9LZjAKkMjBjxZdaMSgclFHrk0ZaaGNK2M8nTdYoKgWsmNaiLOD MaZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from; bh=q3J4HBnNW4Hl+Gjxw0HAbYQSV7ljaMhCOnbd8J0BKfw=; b=BR7CWGsjZ/y4B04z+i8sqfkIO6yU/lspGUzIwOuljoeYCehyXQYRWolwTmjhLKGpVg sGek7aqKhnjAQYat70hAcIZdwBb5ykW5nAAxpqVWGHWzGi2agrOvo1DWEA4xSGp1k7S/ 4Gl6WPAEFgNkUzL88DREbmoLUVJUhMYWx84VZr1xKjSnjRDw/0gX9YuAy2kTZdme70jo iqN9CNERNeh4U/6xdZfIiGqSx3UtIikt+IaiUWvRzB66Pt+3fZiIVPAGc3b7kpeQvKCY q5MKwlmoozYhIJBWXrq/KjpxjjZv8j/vifizVOE/7ZOeLvmWX3W995ChfbGT+7I+sj7+ TX8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q17si1784678ejx.139.2019.09.26.15.58.59; Thu, 26 Sep 2019 15:59:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728585AbfIZW4S (ORCPT + 99 others); Thu, 26 Sep 2019 18:56:18 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:39096 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725943AbfIZW4R (ORCPT ); Thu, 26 Sep 2019 18:56:17 -0400 Received: by mail-wm1-f65.google.com with SMTP id v17so4177714wml.4; Thu, 26 Sep 2019 15:56:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=q3J4HBnNW4Hl+Gjxw0HAbYQSV7ljaMhCOnbd8J0BKfw=; b=OGcVLqNDzgAxc2ptvHjEJc0ZnwDU+dw0zjb3h1aCQBF9EI5cq/LjPDZNYcm8rVYcB3 yWUVna7KCPCAomjPQVODfwf2sBswGjY3TYOxR6o2BZ06XNQHTCLYinXTfDrDXwvsVJBW NKQBR/jf7Itslea+zewbR842C8+FDa/rPHIT9dqYDJCjR71WO53XPlZMNUfTyJwkKpVr NzgSobk/sbtPj6Lpwsjp8xAx6AkaVAtHx5B3lLFULed6HdOfoRwCQ6eEKo8Jbn7SUC81 xoCTp2AubiWE+YmzLRFgXGxALTme01kpIocxZ2x80dkidGoFp6X5kUjdemN0pTPT67Xt iTzw== X-Gm-Message-State: APjAAAV6zLbTVlt/pc6MvSipCKYaXTaoYxJPMTZxthHBBq3mNP+5J12p C0M6K4tFSA7eyjqroyjOzfo= X-Received: by 2002:a1c:a516:: with SMTP id o22mr5117224wme.116.1569538575651; Thu, 26 Sep 2019 15:56:15 -0700 (PDT) Received: from localhost.localdomain (broadband-188-32-48-208.ip.moscow.rt.ru. [188.32.48.208]) by smtp.googlemail.com with ESMTPSA id f17sm668350wru.29.2019.09.26.15.56.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 15:56:14 -0700 (PDT) From: Denis Efremov Cc: Denis Efremov , ath9k-devel@qca.qualcomm.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Rajkumar Manoharan , "John W . Linville" , Kalle Valo , "David S. Miller" , stable@vger.kernel.org Subject: [PATCH] ath9k_hw: fix uninitialized variable data Date: Fri, 27 Sep 2019 01:56:04 +0300 Message-Id: <20190926225604.9342-1-efremov@linux.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, data variable in ar9003_hw_thermo_cal_apply() could be uninitialized if ar9300_otp_read_word() will fail to read the value. Initialize data variable with 0 to prevent an undefined behavior. This will be enough to handle error case when ar9300_otp_read_word() fails. Fixes: 80fe43f2bbd5 ("ath9k_hw: Read and configure thermocal for AR9462") Cc: Rajkumar Manoharan Cc: John W. Linville Cc: Kalle Valo Cc: "David S. Miller" Cc: stable@vger.kernel.org Signed-off-by: Denis Efremov --- drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c index 2b29bf4730f6..b4885a700296 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c @@ -4183,7 +4183,7 @@ static void ar9003_hw_thermometer_apply(struct ath_hw *ah) static void ar9003_hw_thermo_cal_apply(struct ath_hw *ah) { - u32 data, ko, kg; + u32 data = 0, ko, kg; if (!AR_SREV_9462_20_OR_LATER(ah)) return; -- 2.21.0