Skip to content

Commit

Permalink
serial: 8250_pci: make setup_port() parameters explicitly unsigned
Browse files Browse the repository at this point in the history
[ Upstream commit 3a96e97 ]

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 <jirislaby@kernel.org>
Reported-by: Jordy Zomer <jordy@pwning.systems>
Link: https://lore.kernel.org/r/20210726130717.2052096-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
gregkh committed Sep 18, 2021
1 parent 2603740 commit d0a8ef0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/tty/serial/8250/8250_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,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;

Expand Down

0 comments on commit d0a8ef0

Please sign in to comment.