Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8856a7d6 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Greg Kroah-Hartman
Browse files

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: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9800ee6f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2391,7 +2391,7 @@ static int __devinit sci_probe_single(struct platform_device *dev,
			   index+1, SCI_NPORTS);
		dev_notice(&dev->dev, "Consider bumping "
			   "CONFIG_SERIAL_SH_SCI_NR_UARTS!\n");
		return 0;
		return -EINVAL;
	}

	ret = sci_init_single(dev, sciport, index, p);