mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>, Jonathan Corbet <corbet@lwn.net>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Subject: [PATCH] Documentation/rs485: Fix missing zero init on sample code
Date: Mon,  6 Nov 2017 11:51:02 +0100	[thread overview]
Message-ID: <20171106105102.3051-1-ricardo.ribalda@gmail.com> (raw)

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

             reply	other threads:[~2017-11-06 10:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-06 10:51 Ricardo Ribalda Delgado [this message]
2017-11-07 13:28 ` Jiri Slaby
2017-11-07 16:09   ` Ricardo Ribalda Delgado

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171106105102.3051-1-ricardo.ribalda@gmail.com \
    --to=ricardo.ribalda@gmail.com \
    --cc=corbet@lwn.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®