Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4293184pxu; Tue, 1 Dec 2020 01:02:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJzMz99RHMtZHZnSDLXqpEuW2BPn4lpA9wm0SPZBq3Qi5mgzhmAXA6RXeok3JWYcEcAr+B63 X-Received: by 2002:a05:6402:114c:: with SMTP id g12mr1903598edw.167.1606813342388; Tue, 01 Dec 2020 01:02:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606813342; cv=none; d=google.com; s=arc-20160816; b=ZOvXHTPNm4oFXi4TbmRtFDIy4UWwSEYoLLZz+z4w+KfW2tjW8aHb95eYtRc93RtVpt QuNfiajsNnvM9oiLBafgnUlYqMdc2ixK80UwpCXAujNEO8iOKDXWoZlAttiGSLXp/Vgc lsPIURsKQOItdlnngojcQGDXmzMGPj41cW8bxewgM3pbL655ZKaIyc5meswiK+ahEx4y L1+uqnJiNyyIi6M5DRwHT8mgRzfTYOzGojbPcTWLsbyDmT3goPV37zSbOZutc7NupqYJ 9tqvOhvvoAJ6mnrbXz7twi//nZQ4SkfCe1JauiJ1y6PhZT48DFSN1dONyDD9+UTEQ1+V /ilg== 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=TQbxEhe2r2/sqdbMno1QCsnYFkSAqj8l4J69ZCz+DD4=; b=E6Z+lS9THoTgW4O25AM6I4vDEBkx3gfJw5O+haGf+9d/9j7L/gesnI9OOnZ2ZbyNPg EY3stUwkMgg4E+nFFsYkiJYhYg8zG8mfNg31iDJba9/zu2szHyYapiPLw4WsDq2OtpIu LlbqjO4NflLb6c/PaQekUlTcYpKgWhXJAiBRbfPqQQIHoqq3XYsvkYPaheH4H287pe+1 U1ru595OhER12n2YonT8R+ptTg5pe58aIliGEMpBqW1OFBOIQcBE/AyceEBfTQRT9EKK 5JWMnSoJ7D3rUAa4xvyru4HQmUe1fkA8ZC9NgIQw+2l606RStcwnabQhLBU/2g+j38KD R2Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=efGlvwi4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a5si697422edu.121.2020.12.01.01.01.59; Tue, 01 Dec 2020 01:02:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=efGlvwi4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2388076AbgLAI7J (ORCPT + 99 others); Tue, 1 Dec 2020 03:59:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:34198 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388042AbgLAI66 (ORCPT ); Tue, 1 Dec 2020 03:58:58 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AEC60221FD; Tue, 1 Dec 2020 08:58:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606813122; bh=tEbF9PCNWK2JOYfpN4cidgR+ttLyUUfOl1UQEYaWWU8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=efGlvwi4KbiYdoifLyM2F2jyWi1VukRDGY6EHpL8BLfXQ2WxK0OSWREaQvARB3plo lqL6rSkfAHXjsjiEsvJ7HU/EII/JsF+Q3exeQpkTOw0vzyO1eqHVTfT7qX1nfwF6r+ ngq9ieFj+GUjgabwM9epAvK/IO7okgEDultPGgig= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tosk Robot , Kaixu Xia , Hans de Goede , Sasha Levin Subject: [PATCH 4.14 40/50] platform/x86: toshiba_acpi: Fix the wrong variable assignment Date: Tue, 1 Dec 2020 09:53:39 +0100 Message-Id: <20201201084650.007246981@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201201084644.803812112@linuxfoundation.org> References: <20201201084644.803812112@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kaixu Xia [ Upstream commit 2a72c46ac4d665614faa25e267c3fb27fb729ed7 ] The commit 78429e55e4057 ("platform/x86: toshiba_acpi: Clean up variable declaration") cleans up variable declaration in video_proc_write(). Seems it does the variable assignment in the wrong place, this results in dead code and changes the source code logic. Fix it by doing the assignment at the beginning of the funciton. Fixes: 78429e55e4057 ("platform/x86: toshiba_acpi: Clean up variable declaration") Reported-by: Tosk Robot Signed-off-by: Kaixu Xia Link: https://lore.kernel.org/r/1606024177-16481-1-git-send-email-kaixuxia@tencent.com Signed-off-by: Hans de Goede Signed-off-by: Sasha Levin --- drivers/platform/x86/toshiba_acpi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c index 8221e000c8c23..25955b4d80b0d 100644 --- a/drivers/platform/x86/toshiba_acpi.c +++ b/drivers/platform/x86/toshiba_acpi.c @@ -1497,7 +1497,7 @@ static ssize_t video_proc_write(struct file *file, const char __user *buf, struct toshiba_acpi_dev *dev = PDE_DATA(file_inode(file)); char *buffer; char *cmd; - int lcd_out, crt_out, tv_out; + int lcd_out = -1, crt_out = -1, tv_out = -1; int remain = count; int value; int ret; @@ -1529,7 +1529,6 @@ static ssize_t video_proc_write(struct file *file, const char __user *buf, kfree(cmd); - lcd_out = crt_out = tv_out = -1; ret = get_video_status(dev, &video_out); if (!ret) { unsigned int new_video_out = video_out; -- 2.27.0