Skip to content

ext4: check if ext4_blkdev_get() returns NULL

Ming Lei requested to merge minlei/centos-stream-9:rhel9.5-fix-ext4-panic into main

Upstream Status: RHEL only
JIRA: https://issues.redhat.com/browse/RHEL-30965

ext4_blkdev_get() is only called from ext4_get_dev_journal(), and the
result check is changed to 'if (IS_ERR(bdev_handle))' in commit
a50f2ce0 ("ext4: Convert to bdev_open_by_dev()"), which is actually
wrong, and caused null-ptr-deref issue.

Fix the backport issue by switching back the check to 'if (bdev_handle == NULL)'.

Fixes: a50f2ce0 ("ext4: Convert to bdev_open_by_dev()")
Signed-off-by: Ming Lei ming.lei@redhat.com

Merge request reports