Commit 37d38fa4 authored by Wang Yufen's avatar Wang Yufen Committed by Yongqiang Liu
Browse files

pstore/ram: Fix error return code in ramoops_probe()

stable inclusion
from stable-v4.19.270
commit 6d8c5fc579eb5ab8de263a05b23bf5dae171e96c
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6DPF8


CVE: NA

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

[ Upstream commit e1fce564 ]

In the if (dev_of_node(dev) && !pdata) path, the "err" may be assigned a
value of 0, so the error return code -EINVAL may be incorrectly set
to 0. To fix set valid return code before calling to goto.

Fixes: 35da6094 ("pstore/ram: add Device Tree bindings")
Signed-off-by: default avatarWang Yufen <wangyufen@huawei.com>
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/1669969374-46582-1-git-send-email-wangyufen@huawei.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
parent 3d1f5139
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment