]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
DDF: ensure dl->devname is freed when processing a 'delete device' update.
authorNeilBrown <neilb@suse.de>
Wed, 21 May 2014 03:27:54 +0000 (13:27 +1000)
committerNeilBrown <neilb@suse.de>
Wed, 21 May 2014 03:27:54 +0000 (13:27 +1000)
As this code runs in 'monitor' it cannot just free memory,
it must add it to a list for 'manager' to free.
Fortunate update->space_list exists for just this purpose.
dl->devname might be small, so put it in update->space and
put dl in update->space_list.

Signed-off-by: NeilBrown <neilb@suse.de>
super-ddf.c

index 0c714225df5283f2fc02a3909f73b01f145ae5b4..607f1ea17555aa2f87c4c77723cb3a31951d0c09 100644 (file)
@@ -4597,10 +4597,10 @@ static void ddf_process_phys_update(struct supertype *st,
                        if (dl->pdnum == (signed)ent) {
                                close(dl->fd);
                                dl->fd = -1;
-                               /* FIXME this doesn't free
-                                * dl->devname */
-                               update->space = dl;
                                *dlp = dl->next;
+                               update->space = dl->devname;
+                               *(void**)dl = update->space_list;
+                               update->space_list = (void**)dl;
                                break;
                        }
                }