Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2732862pxj; Mon, 31 May 2021 09:20:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziTNCdTLnSpCRM84u3/R6ptAyaOiBH9+BQuOMdvRPb61T9dgSV/5xgNxdS3cK8MtCtekyi X-Received: by 2002:a05:6e02:dc3:: with SMTP id l3mr18063066ilj.12.1622478058625; Mon, 31 May 2021 09:20:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622478058; cv=none; d=google.com; s=arc-20160816; b=LdROsOZCd3fNqxboWqZoKQfhyiClquWr0MlPKAZPSG+ESYOtpGbAK1PNziMZ06keul nzuihPQZJF4PiK7bGUPsrcAfAD6vt3AKA8C3oTs4TxfY+vgRDgs3FBXHkgRdwYdtIVjI EN2E9mTDfGO8QrbZpzyn/swU3cjIYLxWHghHJ0+PZXABJgA7TeyPI2hckHQWYhkdQAL7 alDdhRg03Zt7EDgBGM7L5oL0CYva944H9jYJlvBfCWnCBiABxmGSCHrST4op2OOv6DJP zXvFO3PcNEenfU1oAWM/Yv04G/GiBsjsIbpfUiuhOPGTgjV+GAXNQgw9ZoEeiQB9aoev kchw== 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=mEIpffb7T7sJXAiwqsxtvH+fp62S841K6p4NDxbUz/Y=; b=vHHrJic7vcdw/3zBMJSw3Fm2aWP/czUoCz0B02AS6VnVFMYUUxEp0p9CZAZ922u0Ov iHAxxPbxH9mXamQEAbwWzCSMrT3x9M9lWJ2VERXgotPXMt53ioGqFIo7LbuaG1A6o87b EJQUz82uOdJ+iouXppOqe3O4uWAN0zRjwttfF7qt1yz8iOM9/31E3JbA3P0E6KGprzTO FetoqKjZPsUYALj0CAsUCkbp459rwDY/KtD8vT7/+UhBTznsaA0eRwCL7xppUB2srGC6 /MvwWDH1fQhX3vt+FW5yE3XObHaIQAZKM+BRtdrsH+Z1Ck27McbNsXVkMsRc2JGhhaFC 7wrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lZPA0455; 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 p12si13551925ilq.5.2021.05.31.09.20.45; Mon, 31 May 2021 09:20:58 -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=lZPA0455; 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 S233864AbhEaQV1 (ORCPT + 99 others); Mon, 31 May 2021 12:21:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:37206 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232635AbhEaOka (ORCPT ); Mon, 31 May 2021 10:40:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8973361C67; Mon, 31 May 2021 13:53:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622469188; bh=bgz08rN2DCK3WLYABRd5v1il0Xy381Xes4KMJi4AMRw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lZPA04555eVSdj+wh6Usj4gDi4xBeY1TisOGpOlBNlSiuyJMGCtJ+9J2xP9WGkX2p ZNNSbSN+ILDbFGV+JxSUb9Nz7P9kIOkTIrZM5ilKZNZpFE0ENlwQFrF8hssN3jostk QG0AeHsOFjLPOizUGaXNPN51il/fydqxvve1V4X4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King Subject: [PATCH 5.12 095/296] serial: tegra: Fix a mask operation that is always true Date: Mon, 31 May 2021 15:12:30 +0200 Message-Id: <20210531130707.111432594@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130703.762129381@linuxfoundation.org> References: <20210531130703.762129381@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 @@ -338,7 +338,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);