nvmem: core: fix cell removal on error
stable inclusion from stable-v5.10.168 commit 1fd7a6a579687fc55e9c5c8cfe787533ee07b2d5 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I7URR4 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=1fd7a6a579687fc55e9c5c8cfe787533ee07b2d5 ---------------------------------------------------- commit db3546d5 upstream. nvmem_add_cells() could return an error after some cells are already added to the provider. In this case, the added cells are not removed. Remove any registered cells if nvmem_add_cells() fails. Fixes: fa72d847 ("nvmem: check the return value of nvmem_add_cells()") Cc: stable@vger.kernel.org Signed-off-by:Michael Walle <michael@walle.cc> Signed-off-by:
Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20230127104015.23839-9-srinivas.kandagatla@linaro.org Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
zhaoxiaoqiang11 <zhaoxiaoqiang11@jd.com>
Loading
Please sign in to comment