lkml.org 
[lkml]   [2017]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] Documentation/rs485: Fix missing zero init on sample code
Date
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 <ricardo.ribalda@gmail.com>
---
Documentation/serial/serial-rs485.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/serial/serial-rs485.txt b/Documentation/serial/serial-rs485.txt
index 389fcd4759e9..2bbae93bf279 100644
--- a/Documentation/serial/serial-rs485.txt
+++ b/Documentation/serial/serial-rs485.txt
@@ -54,7 +54,7 @@
/* Error handling. See errno. */
}

- struct serial_rs485 rs485conf;
+ struct serial_rs485 rs485conf = {};

/* Enable RS485 mode: */
rs485conf.flags |= SER_RS485_ENABLED;
--
2.14.2
\
 
 \ /
  Last update: 2017-11-06 11:52    [W:0.032 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site