Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp514149pxb; Thu, 9 Sep 2021 06:13:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwc/QoNqGv/WbwXQJEUt06DVB/YoqiKM10sUsC0pRC/V6miGB1jDMOkjpFI9BzgyJIQw3Qp X-Received: by 2002:a2e:a782:: with SMTP id c2mr2223418ljf.458.1631193205649; Thu, 09 Sep 2021 06:13:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631193205; cv=none; d=google.com; s=arc-20160816; b=JnyNDzAlPh+f8vx46OirmKQB0a046vLDRFrCODz0kly59FSn7b+IAcM1bx729zUCKZ 6pZ7Kx1LEk3yDbiN+LzmOzvNSouyQ72CigDPBTEHUw8zu+0+wZcFY0VSgmWgAu+JUzko 3YiSc5RwPNfYKsTJu6joP/WPlF4Jy+eU7DNO63DaXxT5gzE+hX7dRTdRexDBXd+p1cdf 6B7uDUzIvLYAUB491q8HQ6IBARrhInBqDeN+0OG5E1GAFk/BTQV1z79yu/7fOYKQvhbl snJ2mqEtWPE51GRiFMjhI6g1sT6kY9iYyqU46AmyvZGewqeTEyYBNJl/cwH//ycq0eJv yknA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8DDjXTBr4GRjyI1KAUOljK7zofce8agyoIpsIKpRH54=; b=E7NLMr+gmtpz4nF5JejZoeqjmVS3ycXxykQxXPRRDLRRbp2rPgbWyHeyj0s+Uf9Gyc xGoSXsIzNv5PGYQ3E87SZRrru/IyIPZ2bHJKmwrYQYT5PmPPojUcFhaSZwkZzIeTXmN4 nO06tXN7nHnM+8EiMYQ+y4IaEcSaBbOZt5ijRc8IszSeOu47p9MDBhqcszXGnQ5gdcvJ LH9JYXwV1v/y1A1XWAGgG9ApJP8cBWf/k1ENrsrPOgY8xeJdECoKcCxxU3JSUZ+XLj37 0USnNzUfumAl7tpYbML0jiRds1niBjtLQDpjSCmWDvst4P6JCHW3qHDkfLCPv4FG/SC+ LaCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AB6u8s3N; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id la20si2215014ejc.3.2021.09.09.06.12.53; Thu, 09 Sep 2021 06:13:25 -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=@kernel.org header.s=k20201202 header.b=AB6u8s3N; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352409AbhIINMX (ORCPT + 99 others); Thu, 9 Sep 2021 09:12:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:43766 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353016AbhIINBp (ORCPT ); Thu, 9 Sep 2021 09:01:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D8EB96328C; Thu, 9 Sep 2021 11:59:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631188773; bh=av8WWl+49meWu0mDLRsOPNjCV8ibfb2FsHfzZaKO2ok=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AB6u8s3NLLYf4f7zygXz+amVT248PI/7orSgpu8YocWQr3mEggqvrKUXeM9SrBYmf sm0J69j7ye2jcO1ek54VLCBn2TZYu4kt18j8zQcfNdKcEdno1uhkuDkhCcjQ8Yekv/ kSxno5cO3GZWLqanxe4hbVErhp1DAKWz7D9t0KONuIsW2tztgqxno1QRPLT7aceII/ sNZKX/ARCJm2xwM7DHd+Xep+PGoIWNwmztzqKtJzolW8v2Oq7tdwj3RwIDlKfAmYFt pvw+lXHUdi1twFGZAzCmUAgXN1UeC8zI94c13yaI6Kl8hvFy5sDg5hemZvV4iXlHxv qb7jH1JOAl+fg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , Jiri Slaby , Jordy Zomer , Sasha Levin , linux-serial@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 26/59] serial: 8250_pci: make setup_port() parameters explicitly unsigned Date: Thu, 9 Sep 2021 07:58:27 -0400 Message-Id: <20210909115900.149795-26-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909115900.149795-1-sashal@kernel.org> References: <20210909115900.149795-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman [ Upstream commit 3a96e97ab4e835078e6f27b7e1c0947814df3841 ] The bar and offset parameters to setup_port() are used in pointer math, and while it would be very difficult to get them to wrap as a negative number, just be "safe" and make them unsigned so that static checkers do not trip over them unintentionally. Cc: Jiri Slaby Reported-by: Jordy Zomer Link: https://lore.kernel.org/r/20210726130717.2052096-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/serial/8250/8250_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c index 071ee37399b7..72015cc7b33f 100644 --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c @@ -73,7 +73,7 @@ static void moan_device(const char *str, struct pci_dev *dev) static int setup_port(struct serial_private *priv, struct uart_8250_port *port, - int bar, int offset, int regshift) + u8 bar, unsigned int offset, int regshift) { struct pci_dev *dev = priv->dev; -- 2.30.2