unblock_monitor(): Check sra is valid before dereferencing

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
Jes Sorensen 2011-11-03 08:09:19 +11:00 committed by NeilBrown
parent 4dab422a65
commit 29b59ca5c3
1 changed files with 2 additions and 0 deletions

2
msg.c
View File

@ -448,6 +448,8 @@ void unblock_monitor(char *container, const int unfreeze)
continue;
sysfs_free(sra);
sra = sysfs_read(-1, e->devnum, GET_VERSION|GET_LEVEL);
if (!sra)
continue;
if (sra->array.level > 0)
to_ping++;
if (unblock_subarray(sra, unfreeze))