diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2012-06-12 18:28:24 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2012-06-12 21:22:10 -0400 |
commit | b6c5ef6f6d3e46d6200b141c30ac000a11b851df (patch) | |
tree | a990e8e93deefb12f55075633a6c164e2742dfa7 /drivers | |
parent | 6dae14216c85eea13db7b12c469475c5d30e5499 (diff) |
serial: sh-sci: Make probe fail for ports that exceed the maximum count
The driver supports a maximum number of ports configurable at compile
time. Make sure the probe() method fails when registering a port that
exceeds the maximum instead of returning success without registering the
port.
This fixes a crash at system suspend time, when the driver tried to
suspend a non-registered port using the UART core.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/tty/serial/sh-sci.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 27df2ad4826b..1bd9163bc118 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c | |||
@@ -2391,7 +2391,7 @@ static int __devinit sci_probe_single(struct platform_device *dev, | |||
2391 | index+1, SCI_NPORTS); | 2391 | index+1, SCI_NPORTS); |
2392 | dev_notice(&dev->dev, "Consider bumping " | 2392 | dev_notice(&dev->dev, "Consider bumping " |
2393 | "CONFIG_SERIAL_SH_SCI_NR_UARTS!\n"); | 2393 | "CONFIG_SERIAL_SH_SCI_NR_UARTS!\n"); |
2394 | return 0; | 2394 | return -EINVAL; |
2395 | } | 2395 | } |
2396 | 2396 | ||
2397 | ret = sci_init_single(dev, sciport, index, p); | 2397 | ret = sci_init_single(dev, sciport, index, p); |