]> git.ipfire.org Git - thirdparty/mdadm.git/commit
mdadm: Fix Segmentation fault. data_offset
authormajianpeng <majianpeng@gmail.com>
Mon, 28 May 2012 23:21:51 +0000 (09:21 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 5 Jun 2012 05:41:14 +0000 (15:41 +1000)
commite9d0fa8c68d531529a3988bbf83ebb2900c11c0d
treeda7b3aa6971cc9102acca1954aa46155601b069a
parentc94996f693f1ac3acfc3dac86b97a7e5d63e4919
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