From: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx> Signed-off-by: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx> --- managemon.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/managemon.c b/managemon.c index 9e0a34d..fceaeb9 100644 --- a/managemon.c +++ b/managemon.c @@ -409,7 +409,13 @@ static int disk_init_and_add(struct mdinfo *disk, struct mdinfo *clone, *disk = *clone; disk->recovery_fd = sysfs_open(aa->devnum, disk->sys_name, "recovery_start"); + if (disk->recovery_fd < 0) + return -1; disk->state_fd = sysfs_open(aa->devnum, disk->sys_name, "state"); + if (disk->state_fd < 0) { + close(disk->recovery_fd); + return -1; + } disk->prev_state = read_dev_state(disk->state_fd); disk->curr_state = disk->prev_state; disk->next = aa->info.devs; -- 1.7.6.4 -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html