libfstools: fix multiple volume_identify usages with the same volume
[project/fstools.git] / libfstools / mtd.c
index a1811c315e8332e4f810865d6960a24ad9edcf19..2603a15303ed589233b106bcb3a3c6bdd85f8b82 100644 (file)
@@ -76,8 +76,10 @@ static int mtd_volume_load(struct mtd_volume *p)
        struct mtd_info_user mtdInfo;
        struct erase_info_user mtdLockInfo;
 
-       if (p->fd)
+       if (p->fd) {
+               lseek(p->fd, 0, SEEK_SET);
                return 0;
+       }
 
        if (!p->chr)
                return -1;