]> git.ipfire.org Git - thirdparty/mdadm.git/commit
mdadm: Fix Segmentation fault.
authormajianpeng <majianpeng@gmail.com>
Mon, 28 May 2012 23:21:51 +0000 (09:21 +1000)
committerNeilBrown <neilb@suse.de>
Thu, 27 Sep 2012 06:49:54 +0000 (16:49 +1000)
commit0d478e243a90a48fe4da581c7302771f0d66fb3b
treecc62a2e9f70ba7bc2ff386bcffa3d8608cae6139
parentb7e05d2373313dd8d0cb687479ad58a88f37d29f
mdadm: Fix Segmentation fault.

In function write_init_super1():
If "rv = store_super1(st, di->fd)" return error and the di is the last.
Then the di = NULL && rv > 0, so exec:
if (rv)
    fprintf(stderr, Name ": Failed to write metadata to%s\n",
       di->devname);
will be segmentation fault.

Signed-off-by: majianpeng <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
super1.c