mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-29 23:24:11 +08:00
serial: vt8500: add missing braces
Due to missing braces on an if statement, in presence of a device_node a port was always assigned -1, regardless of any alias entries in the device tree. Conversely, if device_node was NULL, an unitialized port ended up being used. This patch adds the missing braces, fixing the issues. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Acked-by: Tony Prisk <linux@prisktech.co.nz> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
b4e788df8d
commit
d969de8d83
@ -561,12 +561,13 @@ static int vt8500_serial_probe(struct platform_device *pdev)
|
||||
if (!mmres || !irqres)
|
||||
return -ENODEV;
|
||||
|
||||
if (np)
|
||||
if (np) {
|
||||
port = of_alias_get_id(np, "serial");
|
||||
if (port >= VT8500_MAX_PORTS)
|
||||
port = -1;
|
||||
else
|
||||
} else {
|
||||
port = -1;
|
||||
}
|
||||
|
||||
if (port < 0) {
|
||||
/* calculate the port id */
|
||||
|
Loading…
Reference in New Issue
Block a user