]> 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>
Mon, 28 May 2012 23:21:51 +0000 (09:21 +1000)
commit4687f160276a8f7815675ca758c598d881f04fd7
treeb46ccbeafb6ae82f0c37a63004a53ed9342d02c3
parent572d7091f74e28fd2c15de210a57b060dd247dae
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