From: Andrew Morton Date: Mon, 10 Jul 2006 11:44:20 +0000 (-0700) Subject: [PATCH] md: fix oops in error-handling X-Git-Tag: Ubuntu-5.4-5.4.0-11.14~50556 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=d0a0a5ee7a0094231a11cfe3f86d2d8f5f994e01;p=mirror_ubuntu-focal-kernel.git [PATCH] md: fix oops in error-handling During early MD setup (superblock reading), we don't have a personality yet. But the error-handling code tries to dereference mddev->pers. Fix. Acked-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/md/md.c b/drivers/md/md.c index a5286beddcf5..b6d16022a53e 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -4592,6 +4592,8 @@ void md_error(mddev_t *mddev, mdk_rdev_t *rdev) __builtin_return_address(0),__builtin_return_address(1), __builtin_return_address(2),__builtin_return_address(3)); */ + if (!mddev->pers) + return; if (!mddev->pers->error_handler) return; mddev->pers->error_handler(mddev,rdev);