Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@bootlin.com>
To: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Cc: David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Boris Brezillon <boris.brezillon@bootlin.com>,
	Marek Vasut <marek.vasut@gmail.com>,
	Richard Weinberger <richard@nod.at>,
	linux-mtd@lists.infradead.org,
	Quentin Schulz <quentin.schulz@bootlin.com>
Subject: [PATCH mtd-utils] ubi-utils: ubimkvol: Initialize req to zero to make sure no flags are set by default
Date: Thu, 26 Jul 2018 16:05:29 +0200	[thread overview]
Message-ID: <20180726140529.6261-1-boris.brezillon@bootlin.com> (raw)

The program expects req.flags to be zero-initialized, but it's not
the case. Let's explicitly initialize req to zero at declaration time.

Fixes: 7b4a65a27d26 ("ubi-utils: ubimkvol: add support for skipping CRC check of a static volume when opening")
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
---
 ubi-utils/ubimkvol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ubi-utils/ubimkvol.c b/ubi-utils/ubimkvol.c
index 195006133216..b709b43a8318 100644
--- a/ubi-utils/ubimkvol.c
+++ b/ubi-utils/ubimkvol.c
@@ -221,7 +221,7 @@ int main(int argc, char * const argv[])
 	libubi_t libubi;
 	struct ubi_dev_info dev_info;
 	struct ubi_vol_info vol_info;
-	struct ubi_mkvol_request req;
+	struct ubi_mkvol_request req = { };
 
 	err = parse_opt(argc, argv);
 	if (err)
-- 
2.14.1

             reply	other threads:[~2018-07-26 14:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-26 14:05 Boris Brezillon [this message]
2018-07-26 14:09 ` [PATCH mtd-utils] ubi-utils: ubimkvol: Initialize req to zero to make sure no flags are set by default Quentin Schulz
2018-07-26 22:57 ` David Oberhollenzer

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=20180726140529.6261-1-boris.brezillon@bootlin.com \
    --to=boris.brezillon@bootlin.com \
    --cc=computersforpeace@gmail.com \
    --cc=david.oberhollenzer@sigma-star.at \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=quentin.schulz@bootlin.com \
    --cc=richard@nod.at \
    /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