Skip to content

Commit

Permalink
Merge tag 'tty-5.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
torvalds committed Oct 26, 2019
2 parents 228bd62 + f50b680 commit 2976895
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/tty/serial/8250/8250_men_mcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ static int serial_8250_men_mcb_probe(struct mcb_device *mdev,
{
struct serial_8250_men_mcb_data *data;
struct resource *mem;
unsigned int num_ports;
unsigned int i;
int num_ports;
int i;
void __iomem *membase;

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

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

static void serial_8250_men_mcb_remove(struct mcb_device *mdev)
{
unsigned int num_ports, i;
int num_ports, i;
struct serial_8250_men_mcb_data *data = mcb_get_drvdata(mdev);

if (!data)
Expand Down

0 comments on commit 2976895

Please sign in to comment.