Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp407267pxu; Tue, 1 Dec 2020 14:29:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJxeYAlCRBWc+xq76OXUltehCrwnnQqrTovC9wPZn6VVKgBWo9WXGe9chaUjGZajfooiJG9A X-Received: by 2002:a50:8004:: with SMTP id 4mr5290848eda.329.1606861774810; Tue, 01 Dec 2020 14:29:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606861774; cv=none; d=google.com; s=arc-20160816; b=gES7en0a7b9LG/f9OrtIdiDbYUr19WIQ6jzhqJb4TD2SLUq+E076yxh65yODUEGS7k b6/Z/jil/rs51dNF2qUXHCDOsWHO3UPnbq0dTZ08Z3VXHmm40Tci+gLhtczqCATlRE5W KfPoKrqrVl7x8DJWtHeHxlXyV55NvsvKVpKWxIEJOG6Dwta+QZCvDM61o8jRUhJY+VVP Ca16X78WUJSvAWjhPEvhrVKOEWQF5hp7ZG95wxNd8NRtCU023RnSVfULVXZJSE8L7/Zb zzFoLNDtmTEsN6RD1Vsq2hAKn0PLimH5b8Tvb9InaXYExJQ6bvfOHcukpC+Yb0ixLqZ8 kEbA== 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=W7v8fDfGYCHc5huIMzi7AcNJyweZTNcV4oWahgRTxrA=; b=wCcA6DjXqiq6uRNr7ca0xY5IAsA54kMXUr82XlAFgzIRNf89ndTOCpCu9PdlFAOjdh pUs7sjA+w5DgbGCmA0r39FHGM0fXz7yjHufh7MIj+G74fpim+axXxJ3bmyybhip1GoRA sYUj9K32rrHTHJ+DrI353hv/C63DKdfgnvUfCahRkh11vVLyiZtUOGYjidHW475eXXuC nQAamullS3OBljV3k4hH/IVbjgnVH0JzGhpiXroj0X4n6zXflMbzpsF5ZVq0gahhoK3o EQYkbNdbOpNypmlu2hWKRWrzGNtncqDEEgfHZYjGT3/UOlIfgnRQxwcir9hM9RycBqF7 EalQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=L3nEDzw9; 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 s15si777746edx.431.2020.12.01.14.29.12; Tue, 01 Dec 2020 14:29:34 -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=L3nEDzw9; 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 S2390139AbgLAJNn (ORCPT + 99 others); Tue, 1 Dec 2020 04:13:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:51684 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389205AbgLAJNh (ORCPT ); Tue, 1 Dec 2020 04:13:37 -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 4793F2067D; Tue, 1 Dec 2020 09:13:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606814001; bh=pg5bIhmyiHiWxFSf1IHbvlih6IMB1EbUAL2DJejTdOA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L3nEDzw9FQa3YrjZUKdghupLgrjtMYR4Z1dgbjXfLrak7OXURFDAAVNrmXnxy5B5T +3seJkkBeot/IHu2nGiX+R+TLYAGyJllc5xYag5lJOxH9ekjRj19BnOR+l7BKgiHWp JYOwl7IDuAgHC9IegBLiOFG+qq49HYbpiBAst6fo= 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 5.9 132/152] platform/x86: toshiba_acpi: Fix the wrong variable assignment Date: Tue, 1 Dec 2020 09:54:07 +0100 Message-Id: <20201201084729.090819213@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201201084711.707195422@linuxfoundation.org> References: <20201201084711.707195422@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 e557d757c6470..fa7232ad8c395 100644 --- a/drivers/platform/x86/toshiba_acpi.c +++ b/drivers/platform/x86/toshiba_acpi.c @@ -1478,7 +1478,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; @@ -1510,7 +1510,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