Commit 29768954 authored by Linus Torvalds's avatar Linus Torvalds

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
parents 228bd624 f50b6805
...@@ -72,8 +72,8 @@ static int serial_8250_men_mcb_probe(struct mcb_device *mdev, ...@@ -72,8 +72,8 @@ static int serial_8250_men_mcb_probe(struct mcb_device *mdev,
{ {
struct serial_8250_men_mcb_data *data; struct serial_8250_men_mcb_data *data;
struct resource *mem; struct resource *mem;
unsigned int num_ports; int num_ports;
unsigned int i; int i;
void __iomem *membase; void __iomem *membase;
mem = mcb_get_resource(mdev, IORESOURCE_MEM); mem = mcb_get_resource(mdev, IORESOURCE_MEM);
...@@ -88,7 +88,7 @@ static int serial_8250_men_mcb_probe(struct mcb_device *mdev, ...@@ -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", dev_dbg(&mdev->dev, "found a 16z%03u with %u ports\n",
mdev->id, num_ports); 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", dev_err(&mdev->dev, "unexpected number of ports: %u\n",
num_ports); num_ports);
return -ENODEV; return -ENODEV;
...@@ -133,7 +133,7 @@ static int serial_8250_men_mcb_probe(struct mcb_device *mdev, ...@@ -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) 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); struct serial_8250_men_mcb_data *data = mcb_get_drvdata(mdev);
if (!data) if (!data)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment