-
由 Jiasheng Jiang 提交于
mainline inclusion from mainline-v6.3-rc4 commit d3aa3e06 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I7I2L8 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.4-rc6&id=d3aa3e060c4a80827eb801fc448debc9daa7c46b -------------------------------- Check alloc_precpu()'s return value and return an error from dm_stats_init() if it fails. Update alloc_dev() to fail if dm_stats_init() does. Otherwise, a NULL pointer dereference will occur in dm_stats_cleanup() even if dm-stats isn't being actively used. Fixes: fd2ed4d2 ("dm: add statistics support") Cc: stable@vger.kernel.org Signed-off-by: NJiasheng Jiang <jiasheng@iscas.ac.cn> Signed-off-by: NMike Snitzer <snitzer@kernel.org> Conflicts: drivers/md/dm-stats.c drivers/md/dm.c Signed-off-by: NLi Lingfeng <lilingfeng3@huawei.com> (cherry picked from commit 23b7b357)
0097dae2