From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Artem Bityutskiy <dedekind1@gmail.com>,
Richard Weinberger <richard@nod.at>,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
Brian Norris <computersforpeace@gmail.com>,
David Woodhouse <dwmw2@infradead.org>,
Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: [PATCH 10/28] UBI: fix uninitialized access of vid_hdr pointer
Date: Tue, 18 Oct 2016 07:17:35 +0200 [thread overview]
Message-ID: <20161018071735.1e8a0e26@bbrezillon> (raw)
In-Reply-To: <20161017221037.1781185-1-arnd@arndb.de>
Hi Arnd,
On Tue, 18 Oct 2016 00:10:13 +0200
Arnd Bergmann <arnd@arndb.de> wrote:
> A rework of UBI that just appeared in linux-next during the merge
> window introduced caused the recover_peb to use a variable that
> is never initialized as seen from this gcc warning:
>
> drivers/mtd/ubi/eba.c: In function ‘recover_peb’:
> drivers/mtd/ubi/eba.c:744:40: error: ‘vid_hdr’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
>
> It seems clear that the change to the function arguments was missing
> the initialization that I'm now adding back to restore the
> way the function was working before.
Thanks for the fix, but Geert already sent a patch for this bug a few
days ago.
Regards,
Boris
>
> Fixes: 3291b52f9ff0 ("UBI: introduce the VID buffer concept")
> Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
> Cc: Richard Weinberger <richard@nod.at>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/mtd/ubi/eba.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/ubi/eba.c b/drivers/mtd/ubi/eba.c
> index 95c4048..2e152be 100644
> --- a/drivers/mtd/ubi/eba.c
> +++ b/drivers/mtd/ubi/eba.c
> @@ -719,7 +719,7 @@ static int try_recover_peb(struct ubi_volume *vol, int pnum, int lnum,
> struct ubi_vid_io_buf *vidb, bool *retry)
> {
> struct ubi_device *ubi = vol->ubi;
> - struct ubi_vid_hdr *vid_hdr;
> + struct ubi_vid_hdr *vid_hdr = ubi_get_vid_hdr(vidb);
> int new_pnum, err, vol_id = vol->vol_id, data_size;
> uint32_t crc;
>
next prev parent reply other threads:[~2016-10-18 5:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-17 22:03 [PATCH 00/28] Reenable maybe-uninitialized warnings Arnd Bergmann
2016-10-17 22:05 ` [PATCH 02/28] [v2] mtd: mtk: avoid warning in mtk_ecc_encode Arnd Bergmann
2016-10-18 5:19 ` Boris Brezillon
2016-10-18 10:12 ` RogerCC.Lin
2016-10-18 19:45 ` Boris Brezillon
2016-10-17 22:10 ` [PATCH 10/28] UBI: fix uninitialized access of vid_hdr pointer Arnd Bergmann
2016-10-18 5:17 ` Boris Brezillon [this message]
2016-10-17 22:19 ` [PATCH 28/28] Kbuild: bring back -Wmaybe-uninitialized warning Arnd Bergmann
2016-10-18 5:08 ` [PATCH 00/28] Reenable maybe-uninitialized warnings Christoph Hellwig
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=20161018071735.1e8a0e26@bbrezillon \
--to=boris.brezillon@free-electrons.com \
--cc=arnd@arndb.de \
--cc=computersforpeace@gmail.com \
--cc=dedekind1@gmail.com \
--cc=dwmw2@infradead.org \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=richard@nod.at \
--cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).