kernel_optimize_test/drivers/visorbus
Zhen Lei bd95a3e159 visorbus: fix error return code in visorchipset_init()
[ Upstream commit ce52ec5beecc1079c251f60e3973b3758f60eb59 ]

Commit 1366a3db3d ("staging: unisys: visorbus: visorchipset_init clean
up gotos") assigns the initial value -ENODEV to the local variable 'err',
and the first several error branches will return this value after "goto
error". But commit f1f537c2e7 ("staging: unisys: visorbus: Consolidate
controlvm channel creation.") overwrites 'err' in the middle of the way.
As a result, some error branches do not successfully return the initial
value -ENODEV of 'err', but return 0.

In addition, when kzalloc() fails, -ENOMEM should be returned instead of
-ENODEV.

Fixes: f1f537c2e7 ("staging: unisys: visorbus: Consolidate controlvm channel creation.")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Link: https://lore.kernel.org/r/20210528082614.9337-1-thunder.leizhen@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-14 16:56:41 +02:00
..
controlvmchannel.h drivers: visorbus: Use the correct style for SPDX License Identifier 2020-04-23 17:02:04 +02:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile drivers: visorbus: move driver out of staging 2017-12-08 16:37:50 +01:00
vbuschannel.h drivers: visorbus: Use the correct style for SPDX License Identifier 2020-04-23 17:02:04 +02:00
visorbus_main.c bus_find_device: Unify the match callback with class_find_device 2019-06-24 05:22:31 +02:00
visorbus_private.h drivers: visorbus: Use the correct style for SPDX License Identifier 2020-04-23 17:02:04 +02:00
visorchannel.c drivers: visorbus: move driver out of staging 2017-12-08 16:37:50 +01:00
visorchipset.c visorbus: fix error return code in visorchipset_init() 2021-07-14 16:56:41 +02:00