FIX: mdadm throws coredump on exit in error case

When mdadm falls in "reduce size" error on takeovered array it jumps
to release and tries execute backward takeover. This time sra pointer
is not initialized and coredump is generated.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
Adam Kwolek 2011-01-17 12:38:13 +11:00 committed by NeilBrown
parent c0dc0ad5f8
commit cf6ac177b4
1 changed files with 1 additions and 2 deletions

3
Grow.c
View File

@ -1599,7 +1599,7 @@ static int reshape_array(char *container, int fd, char *devname,
unsigned long cache;
unsigned long long array_size;
int done;
struct mdinfo *sra;
struct mdinfo *sra = NULL;
msg = analyse_change(info, &reshape);
if (msg) {
@ -1777,7 +1777,6 @@ started:
sra = sysfs_read(fd, 0,
GET_COMPONENT|GET_DEVS|GET_OFFSET|GET_STATE|GET_CHUNK|
GET_CACHE);
if (!sra) {
fprintf(stderr, Name ": %s: Cannot get array details from sysfs\n",
devname);