[PATCH 0/2] dm era: fix metadata_open NULL deref and error propagation
From: ghuicao
Date: Wed Jun 17 2026 - 02:02:52 EST
From: Cao Guanghui <caoguanghui@xxxxxxxxxx>
This series fixes two issues in dm-era:
1. metadata_open() returns NULL on kzalloc failure, but era_ctr() only
checks IS_ERR(), causing a NULL pointer dereference.
2. era_ctr() replaces actual error codes from dm_get_device() and
dm_set_target_max_io_len() with hardcoded -EINVAL, making diagnosis
harder for users.
Both are straightforward fixes with no functional change for the
success path.
Cao Guanghui (2):
dm era: fix NULL pointer dereference in metadata_open()
dm era: fix error code propagation in era_ctr()
drivers/md/dm-era-target.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
--
2.25.1