]> git.baikalelectronics.ru Git - kernel.git/commit
pstore/ram: Fix error return code in ramoops_probe()
authorWang Yufen <wangyufen@huawei.com>
Fri, 2 Dec 2022 08:22:54 +0000 (16:22 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:40:52 +0000 (11:40 +0100)
commit866686ae1803cc43995ce83f860465b6c3414e15
treeccb9364213dacf7296fc87ff1ea1e8a806c65733
parent2aa64cdfcf6a5e97a70e7f11dc082ad92ea824bf
pstore/ram: Fix error return code in ramoops_probe()

[ Upstream commit 9121c005ace8f8bd77987fa9c6e75048f5017028 ]

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: b88f598444a7 ("pstore/ram: add Device Tree bindings")
Signed-off-by: Wang Yufen <wangyufen@huawei.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/1669969374-46582-1-git-send-email-wangyufen@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/pstore/ram.c