Commit ad628dad authored by 蒋家盛's avatar 蒋家盛 Committed by Yongqiang Liu
Browse files

dm stats: check for and propagate alloc_percpu failure

stable inclusion
from stable-v4.19.280
commit 0d96bd507ed7e7d565b6d53ebd3874686f123b2e
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I715PM


CVE: NA

--------------------------------

commit d3aa3e06 upstream.

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: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
parent 571b0419
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment