Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3329267rwa; Tue, 23 Aug 2022 02:59:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR5JpaQCQglsiXAFoA6Kg86C0Zpl4SynCIjrpeg+nFq52vwmkF4o3qmIDgHKKLnv1BK53n5f X-Received: by 2002:a05:6402:401d:b0:446:6f14:831d with SMTP id d29-20020a056402401d00b004466f14831dmr3142680eda.18.1661248749137; Tue, 23 Aug 2022 02:59:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661248749; cv=none; d=google.com; s=arc-20160816; b=rqYa08H1AdcN4jsfWHMmlWmfO49e6lFoBJ+oS4Vyl2pKxKxtWqfK6AIhT3zQt4lXAW x+yNF+nOp1y8ywBXmGlcHaeLKTex/YxODLNVHT8WzaVpDd+FEUXNB/QkkvHX6SgAYiXc FCduzLe00ms0GSHGlN818Qfi0pis8mj5z8OkS6NeQZ9+KDC9EKJftfX1/01gWY3HXGvn JpK/Of07CdMWNWyCr3L5ML65S6KYxU8/enoa2c2pV63GoUtuxKwWweZpzQ4pFIsoi7Ft YKYQWS9P/kaXKUUH4sQkLHyoX5iUtEq8SoL/H4yjktR4ltpKG/D42QgjUHYKrCnMx0Sf ImYQ== 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=1knoK34sgf+ZWg3rb/yMDQe2UjT+37sQjRNDtm8r/74=; b=PA0SXrD1rxEbFgFlrYf7EK4ckwnHtv2jsedfo2Yc6JAosHJUjPvl8cdivwABH+/Gq+ Dp72vVtEYk5VSFjTuTPzABlT3g6z0oPr1AwUP3gaPqiLdmoWY0pnGnUx8BO7G+T2Gz4K lscLJN8C0NpOH1+fbl/pg01nTizslwGZ1X+P3FJhbgELSen+F1GX2ZCeR1gFCRAlWDop y1LxS5yQ+kydXgH1Xy3RaO4gzj/S3Qmpr1uJ8H8QVMfhqfX2kf1nrQY185LHeD8+WD95 rCNgOIPqJQmsmI6ZsLefBCqclNsd4qC4eaYdYmzmvXeBxXvi7TpKRSkQrBn2mxrhjsjp L58g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=s6zu0v84; 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 qk34-20020a1709077fa200b0073d6472b3ccsi8807033ejc.214.2022.08.23.02.58.42; Tue, 23 Aug 2022 02:59:09 -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=s6zu0v84; 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 S240881AbiHWJpH (ORCPT + 99 others); Tue, 23 Aug 2022 05:45:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352510AbiHWJl3 (ORCPT ); Tue, 23 Aug 2022 05:41:29 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 296217A776; Tue, 23 Aug 2022 01:42:09 -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 EF052B81C5A; Tue, 23 Aug 2022 08:42:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 347F0C433D6; Tue, 23 Aug 2022 08:42:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244127; bh=0wtt/finx1+7hAbJi3lID1sNUwsIJoWXJGmn7vUrD3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s6zu0v84CE/Z/Vn8u3dkkeeR2RV6yoOGl8SiGr3bD+XL0DLqkyt0DwEppS04DSS8a Fpf7BCCtcFp5ET0ka0dfe2kChoqv19YLyZa8hYf5JE5pnnUx/kMCUkByjzUMme9PYz rgfE34YjFzIzdYhbG3ONX82BI0i+owAw03X3gz1A= 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.14 090/229] wifi: wil6210: debugfs: fix uninitialized variable use in `wil_write_file_wmi()` Date: Tue, 23 Aug 2022 10:24:11 +0200 Message-Id: <20220823080056.923998996@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080053.202747790@linuxfoundation.org> References: <20220823080053.202747790@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 2da52145cb60..12aec63d8c06 100644 --- a/drivers/net/wireless/ath/wil6210/debugfs.c +++ b/drivers/net/wireless/ath/wil6210/debugfs.c @@ -834,7 +834,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; @@ -851,7 +851,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