Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758069AbcJQWLk (ORCPT ); Mon, 17 Oct 2016 18:11:40 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:51180 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757929AbcJQWL2 (ORCPT ); Mon, 17 Oct 2016 18:11:28 -0400 From: Arnd Bergmann To: Artem Bityutskiy , Richard Weinberger Cc: Linus Torvalds , linux-kernel@vger.kernel.org, Arnd Bergmann , Boris Brezillon , David Woodhouse , Brian Norris , linux-mtd@lists.infradead.org Subject: [PATCH 10/28] UBI: fix uninitialized access of vid_hdr pointer Date: Tue, 18 Oct 2016 00:10:13 +0200 Message-Id: <20161017221037.1781185-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161017220342.1627073-1-arnd@arndb.de> References: <20161017220342.1627073-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:MzkD/XJ6K1jpmbgJupM7J0Ne3pcDm3T/jtJT2zhPnI/j9yvDV6T gybqF/lp8u5lGbxzWWsvO7yy5oX4Y9B9F1ufNquP4do5s0Wqi3eoONEYqJ95am5g0SIjbr6 BrozUekuZOgo055uW1qnHdEBwRysVPghe2f0hlB/TjwdtqW7ycOU1NsQedzqDvcEAMLGxjX Svq49ynpX18N+Y/nnA0DQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:pFEGSZ5/XHE=:MGSSn4yLWYIMU+NN1fxX4m HXJrVPA2tU+1eMPFwYBCaz6qH/0D9se3uhf6v+jqXcovBMcEiLjXxrGxrFX75wkP0cvT976Ia +pBCLMkoZMPbIiSH7zWs4KQkNhqeAe1A6UE2zHRF/r0ygKxcnkQnxD/vq1uyeOzsyoOTBRf6l m3/L1h3e/czbxRi2wCdysbwieqlI8YDwTVdwNAEgq6XwcNi0JjnMxvNtibuOfMVtk3ggGdTPz g6tIxxsKyjAfuYrYCls6ZC3sOujKJTjc7Es1wOYbNRbykFi0Ec33mq9EYjVGrn2tYEPwoGqKm nLFB6ivTwnZLlHqqaZqoSEeRkS0jt4qR2dQMqEttmiIH/arAyGx4SP81eYiGySRu26s9o84vD 8l+ysSXrGqUzKcU1+iDrSfmw20faOe8c44RhHdx3vynRhMq5AKEmPhQXK4oKlfMO6Ek2waArF PHS3hfzCBOdDTauR5tiKdoA05zaCBDgdNgsfPJ1SuW5x0JLjcb4zCWpl6d4muGKVCZN03/0Op TwlaYVakfi+8VjdEopISbVYW9Hw4s1eNVggvQVEojk/squGvW1VGK/lL7Vdh6SnuuSEoRa0wL fSWFsl21MXWDs6Z+ZgEYTYkHhvPxH/M0xB+5UFd1JaEeJSN6gVnJz96E8C5hD4m+I30GJy6oP JgJuaOZQ5kIrynoGm/vOFTiqX9T39xIvK1v/LgpAqrrjfNGep/ubjPbTAGQRRmgSKfvDZPY9i rQ45xyQEopIZCdDG Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1307 Lines: 34 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. Fixes: 3291b52f9ff0 ("UBI: introduce the VID buffer concept") Cc: Boris Brezillon Cc: Richard Weinberger Signed-off-by: Arnd Bergmann --- 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; -- 2.9.0