nvmem: core: add error handling for dev_set_name
stable inclusion from stable-v5.10.169 commit a19a0f67dbb89ad2bfc466f2003841acba645884 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I7V9QX Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a19a0f67dbb89ad2bfc466f2003841acba645884 ---------------------------------------------------- [ Upstream commit 5544e90c ] The type of return value of dev_set_name is int, which may return wrong result, so we add error handling for it to reclaim memory of nvmem resource, and return early when an error occurs. Signed-off-by:Gaosheng Cui <cuigaosheng1@huawei.com> Signed-off-by:
Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20220916122100.170016-4-srinivas.kandagatla@linaro.org Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Stable-dep-of: ab3428cf ("nvmem: core: fix registration vs use race") Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
zhaoxiaoqiang11 <zhaoxiaoqiang11@jd.com>
Loading
Please sign in to comment