]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libfdisk: fix list_del after partition reset
authorVaclav Dolezal <vdolezal@redhat.com>
Wed, 9 May 2018 14:35:38 +0000 (16:35 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 11 Jul 2018 13:41:01 +0000 (15:41 +0200)
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
libfdisk/src/partition.c

index 085d0cfab580237e94ce9d5ebb526b0853d38127..a790dc9c9420f7a115bdaa2224e9ab706406f690 100644 (file)
@@ -130,8 +130,8 @@ void fdisk_unref_partition(struct fdisk_partition *pa)
 
        pa->refcount--;
        if (pa->refcount <= 0) {
-               fdisk_reset_partition(pa);
                list_del(&pa->parts);
+               fdisk_reset_partition(pa);
                DBG(PART, ul_debugobj(pa, "free"));
                free(pa);
        }