Documentation/rs485: Fix missing zero init on sample code
PATCH 1/1 Documentation/rs485: Fix missing zero init on sample code
The sample code does not initialize to zero a local variable and then it uses the uninitialized code.
Fix in case someone copy/paste the sample code.
--- Documentation/serial/serial-rs485.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/serial/serial-rs485.txt +1 -1
@@ -54,7 +54,7 @@ /* Error handling. See errno. */ } - struct serial_rs485 rs485conf; + struct serial_rs485 rs485conf = {}; /* Enable RS485 mode: */ rs485conf.flags |= SER_RS485_ENABLED;
Signature · 1 line
2.14.2
Quoted 15 lines · Ricardo Ribalda Delgado
The sample code does not initialize to zero a local variable and then it uses the uninitialized code.
Fix in case someone copy/paste the sample code.
Signed-off-by Ricardo Ribalda Delgado <[email protected]>--- Documentation/serial/serial-rs485.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Documentation/serial/serial-rs485.txt +0
-0
Documentation/serial/serial-rs485.txt line 57
Quoted 5 lines
Documentation/serial/serial-rs485.txt +1
-1@@ -54,7 +54,7 @@ /* Error handling. See errno. */ } - struct serial_rs485 rs485conf; + struct serial_rs485 rs485conf = {};
I think that TIOCGRS485 is missing here instead. Ccing the author of the text.
Does it break classifying potatoes :)?
Documentation/serial/serial-rs485.txt
Quoted 3 lines
Documentation/serial/serial-rs485.txt +0
-0/* Enable RS485 mode: */ rs485conf.flags |= SER_RS485_ENABLED;
thanks,
Signature · 2 lines
js suse labs
Hi Jiri
Quoted 19 lines · Jiri Slaby
Quoted 18 lines · Ricardo Ribalda Delgado
The sample code does not initialize to zero a local variable and then it uses the uninitialized code.
Fix in case someone copy/paste the sample code.
Signed-off-by Ricardo Ribalda Delgado <[email protected]>--- Documentation/serial/serial-rs485.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Documentation/serial/serial-rs485.txt +0
-0@@ -54,7 +54,7 @@ /* Error handling. See errno. */ }
Quoted 6 lines
Documentation/serial/serial-rs485.txt line 57
Quoted 2 lines
Documentation/serial/serial-rs485.txt +1
-1- struct serial_rs485 rs485conf; + struct serial_rs485 rs485conf = {};I think that TIOCGRS485 is missing here instead. Ccing the author of the text.
That will also do.
Quoted 1 line
Does it break classifying potatoes :)?
The potato machine has to speak to other industrial machines :).
Hey!: I am running of potatoes!, Need another truck.
Quoted 9 lines
Documentation/serial/serial-rs485.txt
Quoted 4 lines
Documentation/serial/serial-rs485.txt +0
-0/* Enable RS485 mode: */ rs485conf.flags |= SER_RS485_ENABLED;thanks,
--
js
suse labs
Signature · 1 line
Ricardo Ribalda