UBI: make vid_hdr non-static
authorRichard Weinberger <rw@linutronix.de>
Thu, 22 Dec 2011 15:12:57 +0000 (16:12 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 26 Jan 2012 00:13:25 +0000 (16:13 -0800)
commit 6bdccffe8c4268d02f71873102131fb6ed37ed9a upstream.

Remove 'static' modifier from the 'vid_hdr' local variable. I do not know
how it slipped in, but this is a bug and will break UBI if someone attaches
2 UBI volumes at the same time.

Artem: amended teh commit message, added -stable.

Signed-off-by: Richard Weinberger <rw@linutronix.de>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/mtd/ubi/vtbl.c

index 9ad18da..890754c 100644 (file)
@@ -306,7 +306,7 @@ static int create_vtbl(struct ubi_device *ubi, struct ubi_scan_info *si,
                       int copy, void *vtbl)
 {
        int err, tries = 0;
-       static struct ubi_vid_hdr *vid_hdr;
+       struct ubi_vid_hdr *vid_hdr;
        struct ubi_scan_leb *new_seb;
 
        ubi_msg("create volume table (copy #%d)", copy + 1);