mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 01:32:21 +02:00
dm-verity: fix a possible NULL pointer dereference
Fix a possible NULL pointer dereference dm_verity_loadpin_is_bdev_trusted
if the device has no table.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Assisted-by: Claude:claude-opus-4-6
Fixes: b6c1c5745c ("dm: Add verity helpers for LoadPin")
Cc: stable@vger.kernel.org
This commit is contained in:
parent
72e9ec2fe3
commit
e72b793ae4
|
|
@ -70,7 +70,7 @@ bool dm_verity_loadpin_is_bdev_trusted(struct block_device *bdev)
|
|||
|
||||
table = dm_get_live_table(md, &srcu_idx);
|
||||
|
||||
if (table->num_targets != 1)
|
||||
if (!table || table->num_targets != 1)
|
||||
goto out;
|
||||
|
||||
ti = dm_table_get_target(table, 0);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user