Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2701664pxj; Mon, 31 May 2021 08:35:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCexhG3lMOSN8QuQkHZmSGKxGhywsQ0GIEpMp47YJVtts44lydXDCL8lNd1lp8FlBI5Y6u X-Received: by 2002:a92:ca4e:: with SMTP id q14mr18167568ilo.220.1622475351819; Mon, 31 May 2021 08:35:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622475351; cv=none; d=google.com; s=arc-20160816; b=huFMtTlEDZCxVvQGHdzznHz1r9pW4jffK+8I2D8jOy7s17JLEir5bEi1d2l1KN+Iq0 Cpv8w7mza3FddEE/Xr657uFDlHsvYcYDeMIiBtfTv4cEX8+2gc2YHdBUf3jqdnmm/wDb 6glsj5ELxUK5VxJ/ow4ow8pQ2BlRmicYFtAVfSIZvTGApEE5e4qRnbr8TJRI9O9t2NfS dqiaka+ZffCu4h5KGHkDhKI9iZtDSaBBwW6JqgQQfmccO6AyyXS6zMNtMJ3oX9AhXqko mDNXvT+SM+9Uzt1/OQJYJbUUggua8YzvsuklpB1cPKlSLR0zV0SKjA//XG/76MKChqDJ cJgw== 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=UPiFSHamSRFcf/dV8OBTkfxwIZ5fc1aIqk1oJEq5saE=; b=UsRi0552dp6l0VZyY9w4GCKAxfFDS34fNPKyV4tpWSSnbLXhge7HzRfu47I0KOPno9 bDz5BNscwcDtjRVE7oRt6N6YchhxAeXLTKT2ar8dX3qerGXfS8likOusHduMdzNcNCw6 gIhu9t4TDeBbCpxlwRRAhTRh7oe+zU/tOknA3ZRHWYFLFZYIezrcLJva7xZC62J4GUWx swi1ngAJj07ViBMS8zEOr5bO+8xgSh+BIemvQYRP/HgaQrXSnWxumJd0PEH2OLGIi46W HGU8gsX8hO0w1Vjef9LDRqyAOe9GXlPq6YdYIAXAF3BfH3YeQ7qA0b1jhDmHRr2mOGlu GxuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jvuznHE6; 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 l11si15657842jaj.50.2021.05.31.08.35.37; Mon, 31 May 2021 08:35:51 -0700 (PDT) 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=jvuznHE6; 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 S232536AbhEaPg3 (ORCPT + 99 others); Mon, 31 May 2021 11:36:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:46126 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233856AbhEaOVb (ORCPT ); Mon, 31 May 2021 10:21:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E96FB6148E; Mon, 31 May 2021 13:44:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468688; bh=fTYm83lxB6rhwV9QngRLik0+nwkWeMZ+EZtosISWU2c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jvuznHE68C8B8Mz38rrnF3BMRAkBRdrlILaj0klVx3x+bHhcJrJaU2Q7e/3VxcxdB xhEojjzkhhzSa44XsWkSM2hVgJWApoAtjy6LGxpUHbnOlNW9E2/rL+qeht/iH7pNQD hPy62+jRM+wSk6aw/6eGKhojg34WtvOOW30UWzTA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King Subject: [PATCH 5.4 053/177] serial: tegra: Fix a mask operation that is always true Date: Mon, 31 May 2021 15:13:30 +0200 Message-Id: <20210531130649.757360994@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130647.887605866@linuxfoundation.org> References: <20210531130647.887605866@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: Colin Ian King commit 3ddb4ce1e6e3bd112778ab93bbd9092f23a878ec upstream. Currently the expression lsr | UART_LSR_TEMT is always true and this seems suspect. I believe the intent was to mask lsr with UART_LSR_TEMT to check that bit, so the expression should be using the & operator instead. Fix this. Fixes: b9c2470fb150 ("serial: tegra: flush the RX fifo on frame error") Signed-off-by: Colin Ian King Cc: stable Link: https://lore.kernel.org/r/20210426105514.23268-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/serial-tegra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/tty/serial/serial-tegra.c +++ b/drivers/tty/serial/serial-tegra.c @@ -332,7 +332,7 @@ static void tegra_uart_fifo_reset(struct do { lsr = tegra_uart_read(tup, UART_LSR); - if ((lsr | UART_LSR_TEMT) && !(lsr & UART_LSR_DR)) + if ((lsr & UART_LSR_TEMT) && !(lsr & UART_LSR_DR)) break; udelay(1); } while (--tmout);