Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3412434rwa; Tue, 23 Aug 2022 04:28:39 -0700 (PDT) X-Google-Smtp-Source: AA6agR6KWhsR77JqmxOB98b1zuUEM28566C9qyFuPWtghAfW60Mt29jhTOHfiljrVBkdJqwKi8sx X-Received: by 2002:a05:6402:5190:b0:447:280a:c3a7 with SMTP id q16-20020a056402519000b00447280ac3a7mr1487478edd.222.1661254119416; Tue, 23 Aug 2022 04:28:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661254119; cv=none; d=google.com; s=arc-20160816; b=vp/EyDfur4XGhhlmue9finM3W9jHYFz9udTk2T2ZuU8zEwtglCXO6FpaHXAprHE9mL ajPOZQmJ4Kp93d3PXeQyqQ0ycqPQqUwd38ByNDU/7usd1PRML0XJsczLCp7P5DLHI4Gk LsXljT/cCa8jyzvtMy/cN+NBJGl51L3zcrRq+i+/orxoCNh2dW0V0b2Q3yJO0Giwwv7K bvsK/9aOcd6O9abBWYJgFtQoSBlXS8xSe05Vqlzhgnasv6S0ohZnJ3lLayu630kXEQNV P9oU7Ji6N4AVjDYozEXBX+OZr+v/RAswfei+m5RMOLmQAf5VohBmyd+GhznmZm0ZEJP5 C8MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=i6q3retIv6r6TZp5UJLZOQ/tef0TPNk707ok3KnodQ0=; b=ZuTrEknnA0NjX4AUMMyj6eqEeXmXDaaZR+PKIQAnh1gI/bSla9TeHGylOY28WwgWB/ nzJGUMH/ztxuobJk/W1x4LGy2C/TH5i97cwTm2j3drUNGdmZ8fhd6suCi9RtrUxzySq/ JOiz0uGOvH/6TXGBUwCKbY0w1Gj7hoHet18d489dG2sPOV2GAXC9wljH0mGTYOpfO5QX j3a15lCa/EL4gZ3S9cNe8sNunmJ0l8Dhg9qtO4Wf1LIn5SZ7unGNOcnMYoLcYMYoIJ9G d/Jb1isARX7QVEAwCfmiyH1A/WY5X9XHq6o8MbWufyIfXoVcYjb8AFMG+UDH2VSI+0R4 56Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="gL/V6suV"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dp17-20020a170906c15100b0073a0d85a0fbsi11320817ejc.626.2022.08.23.04.28.12; Tue, 23 Aug 2022 04:28:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="gL/V6suV"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347733AbiHWKow (ORCPT + 99 others); Tue, 23 Aug 2022 06:44:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355645AbiHWKgs (ORCPT ); Tue, 23 Aug 2022 06:36:48 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DD42A61CD; Tue, 23 Aug 2022 02:07:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 25851B81C94; Tue, 23 Aug 2022 09:07:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E459C433C1; Tue, 23 Aug 2022 09:07:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245631; bh=SrbAtyQryqiIjUrEYkpoAKvWYRMpR7d+M4Tnh4zVXZw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gL/V6suVV2YxdKBwb3xn2neqUNfNTcR0fmIUglAO8n9a8Do2aKhBQ/8JN6ajYo3I/ jPGFgF8lmRghHGbKcY+BLYQS3m/iCcGf0ga6CaeTZfiP4rbE5L7l6KmqQUlWL+sdPf AsWY1g4nqJm3RTLbFFkY8Hkcijtznx5JaJPMxn30= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , kernel test robot , Ammar Faizi , Kalle Valo , Sasha Levin Subject: [PATCH 4.19 107/287] wifi: wil6210: debugfs: fix uninitialized variable use in `wil_write_file_wmi()` Date: Tue, 23 Aug 2022 10:24:36 +0200 Message-Id: <20220823080103.981225238@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ammar Faizi [ Upstream commit d578e0af3a003736f6c440188b156483d451b329 ] Commit 7a4836560a61 changes simple_write_to_buffer() with memdup_user() but it forgets to change the value to be returned that came from simple_write_to_buffer() call. It results in the following warning: warning: variable 'rc' is uninitialized when used here [-Wuninitialized] return rc; ^~ Remove rc variable and just return the passed in length if the memdup_user() succeeds. Cc: Dan Carpenter Reported-by: kernel test robot Fixes: 7a4836560a6198d245d5732e26f94898b12eb760 ("wifi: wil6210: debugfs: fix info leak in wil_write_file_wmi()") Fixes: ff974e4083341383d3dd4079e52ed30f57f376f0 ("wil6210: debugfs interface to send raw WMI command") Signed-off-by: Ammar Faizi Reviewed-by: Dan Carpenter Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220724202452.61846-1-ammar.faizi@intel.com Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/wil6210/debugfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c index 675b2829b4c7..3a46b319e9f1 100644 --- a/drivers/net/wireless/ath/wil6210/debugfs.c +++ b/drivers/net/wireless/ath/wil6210/debugfs.c @@ -1002,7 +1002,7 @@ static ssize_t wil_write_file_wmi(struct file *file, const char __user *buf, void *cmd; int cmdlen = len - sizeof(struct wmi_cmd_hdr); u16 cmdid; - int rc, rc1; + int rc1; if (cmdlen < 0 || *ppos != 0) return -EINVAL; @@ -1019,7 +1019,7 @@ static ssize_t wil_write_file_wmi(struct file *file, const char __user *buf, wil_info(wil, "0x%04x[%d] -> %d\n", cmdid, cmdlen, rc1); - return rc; + return len; } static const struct file_operations fops_wmi = { -- 2.35.1