Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp400970pxu; Tue, 1 Dec 2020 14:18:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJxum42N2/Fj05PS8ZYuF0vH1M1IRug3kArFdd7GpjHGizwduQqsNbYQIG81v3nmAEXQiWSF X-Received: by 2002:a05:6402:3049:: with SMTP id bu9mr5266703edb.127.1606861132706; Tue, 01 Dec 2020 14:18:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606861132; cv=none; d=google.com; s=arc-20160816; b=0SzjmIpsGzfVFuIlfocNsufNxI4ZuayG7D0suaP5xDYhkyZLaOU1C4tiYilSQ9MkUi iZwsm1lqmgQKbkfnz5gliYisjvM8WFvPM8JPtROtR70ie4OkSdjApyGOMnQgirIkQx27 DaxbwK3iSMAjuvW2vt01Q3y3hWg+1oiAdDLx/fma5hmlhpJz9DoqL7pnQBeMgZPd/t7B l76F6zv6QrtsVUgHR9fAsZdhxXQRkPkBBEE1C0NyEK8xh4Fy6lqOsM7IAagOUbM+XRKC RTd/UJ/xcz20wL03+R2nRM+MlRlNd18ytZE6Lj8NQ81e7k7EBpd8+iKj68v+jqBJnqeD Ul1Q== 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=uariPj3hUnCc287fr8yILPED2C9Fuv8CmpEueQ6lVvM=; b=Rx/YhB0WZC7lpfOYBXrNSWVthH/0ps1j+09e8Kw/GoSSQBN4H3gybVokf3BBlu1TqE BkZS1yTnWKE+5aLmhTKzDX3Q5BtwT6suv5Kh9BJilVYZTpfG8QDRQV1UK3avLYm5wYeM jbwQCm74wxcf67YiOJ/6MpipcpsnMdEoprF98EYY+10tKBabvMNrmaXZkSBNQJ6Uzh9G GZp0f6iqX5TPilQ0F5rv8YEjV/Xd/HujDjuDHu/VDDqoC0LfYFOQ2ZNw41x6Aivy+Dhi siOE9ebhwpvJ+22m18o2yjEN1aAR7EO+aOZEPZ4ROztHjlcv/NMxTaHc5cVvL51HFFNQ hpQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2e0WvYVt; 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 y12si747129eju.123.2020.12.01.14.18.30; Tue, 01 Dec 2020 14:18:52 -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=2e0WvYVt; 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 S2387789AbgLAI5H (ORCPT + 99 others); Tue, 1 Dec 2020 03:57:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:58602 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387776AbgLAI5F (ORCPT ); Tue, 1 Dec 2020 03:57:05 -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 94582206D8; Tue, 1 Dec 2020 08:56:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606813010; bh=xU1rQjC7OfyYaTi9ml0RZogbix/lo4WzsaNp7q1Aa6M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2e0WvYVtVmgU6W/UONiCFLzutpzRNsWrlDaLTAgq3a6jQYZzbYqetWbpOwXi5v4BZ SGayrDRHnnaGLiXnGUNAf5IFV+eZO9v6EnFcdqfgU7D9+eeqDR5JPr1PPxw153RuEH hEbFmz9M8269TL6xTOkjy1M8E2cDDmnzw3cnWr7E= 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.9 33/42] platform/x86: toshiba_acpi: Fix the wrong variable assignment Date: Tue, 1 Dec 2020 09:53:31 +0100 Message-Id: <20201201084645.011215155@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201201084642.194933793@linuxfoundation.org> References: <20201201084642.194933793@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 79a2289370729..f25278bb3e1a8 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; @@ -1534,7 +1534,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