--- zzzz-none-000/linux-4.4.60/drivers/md/dm-table.c 2017-04-08 07:53:53.000000000 +0000 +++ scorpion-7490-727/linux-4.4.60/drivers/md/dm-table.c 2021-02-04 17:41:59.000000000 +0000 @@ -464,6 +464,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;