]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.11.7/serial-vt8500-add-missing-braces.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.11.7 / serial-vt8500-add-missing-braces.patch
CommitLineData
7bfc31f3
GKH
1From d969de8d83401683420638c8107dcfedb2146f37 Mon Sep 17 00:00:00 2001
2From: Roel Kluin <roel.kluin@gmail.com>
3Date: Mon, 14 Oct 2013 23:21:15 +0200
4Subject: serial: vt8500: add missing braces
5
6From: Roel Kluin <roel.kluin@gmail.com>
7
8commit d969de8d83401683420638c8107dcfedb2146f37 upstream.
9
10Due to missing braces on an if statement, in presence of a device_node a
11port was always assigned -1, regardless of any alias entries in the
12device tree. Conversely, if device_node was NULL, an unitialized port
13ended up being used.
14
15This patch adds the missing braces, fixing the issues.
16
17Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
18Acked-by: Tony Prisk <linux@prisktech.co.nz>
19Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20
21---
22 drivers/tty/serial/vt8500_serial.c | 5 +++--
23 1 file changed, 3 insertions(+), 2 deletions(-)
24
25--- a/drivers/tty/serial/vt8500_serial.c
26+++ b/drivers/tty/serial/vt8500_serial.c
27@@ -559,12 +559,13 @@ static int vt8500_serial_probe(struct pl
28 if (!mmres || !irqres)
29 return -ENODEV;
30
31- if (np)
32+ if (np) {
33 port = of_alias_get_id(np, "serial");
34 if (port >= VT8500_MAX_PORTS)
35 port = -1;
36- else
37+ } else {
38 port = -1;
39+ }
40
41 if (port < 0) {
42 /* calculate the port id */