--- zzzz-none-000/linux-4.4.271/drivers/md/dm-table.c 2021-06-03 06:22:09.000000000 +0000 +++ hawkeye-5590-750/linux-4.4.271/drivers/md/dm-table.c 2023-04-19 10:22:29.000000000 +0000 @@ -473,6 +473,16 @@ struct list_head *devices = &ti->table->devices; struct dm_dev_internal *dd; + if (!ti) { + DMERR("%s: dm_target pointer is NULL", __func__); + return; + } + + if (!d) { + DMERR("%s: dm_dev pointer is NULL", __func__); + return; + } + list_for_each_entry(dd, devices, list) { if (dd->dm_dev == d) { found = 1;