Skip to content

Commit 2976895

Browse files
committed
Merge tag 'tty-5.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial driver fix from Greg KH: "Here is a single tty/serial driver fix for 5.4-rc5 that resolves a reported issue. It has been in linux-next for a while with no problems" * tag 'tty-5.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: 8250-men-mcb: fix error checking when get_num_ports returns -ENODEV
2 parents 228bd62 + f50b680 commit 2976895

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/tty/serial/8250/8250_men_mcb.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ static int serial_8250_men_mcb_probe(struct mcb_device *mdev,
7272
{
7373
struct serial_8250_men_mcb_data *data;
7474
struct resource *mem;
75-
unsigned int num_ports;
76-
unsigned int i;
75+
int num_ports;
76+
int i;
7777
void __iomem *membase;
7878

7979
mem = mcb_get_resource(mdev, IORESOURCE_MEM);
@@ -88,7 +88,7 @@ static int serial_8250_men_mcb_probe(struct mcb_device *mdev,
8888
dev_dbg(&mdev->dev, "found a 16z%03u with %u ports\n",
8989
mdev->id, num_ports);
9090

91-
if (num_ports == 0 || num_ports > 4) {
91+
if (num_ports <= 0 || num_ports > 4) {
9292
dev_err(&mdev->dev, "unexpected number of ports: %u\n",
9393
num_ports);
9494
return -ENODEV;
@@ -133,7 +133,7 @@ static int serial_8250_men_mcb_probe(struct mcb_device *mdev,
133133

134134
static void serial_8250_men_mcb_remove(struct mcb_device *mdev)
135135
{
136-
unsigned int num_ports, i;
136+
int num_ports, i;
137137
struct serial_8250_men_mcb_data *data = mcb_get_drvdata(mdev);
138138

139139
if (!data)

0 commit comments

Comments
 (0)