Skip to content
Commit ce52ec5b authored by Zhen Lei's avatar Zhen Lei Committed by Greg Kroah-Hartman
Browse files

visorbus: fix error return code in visorchipset_init()



Commit 1366a3db ("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 f1f537c2 ("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: f1f537c2 ("staging: unisys: visorbus: Consolidate controlvm channel creation.")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarZhen Lei <thunder.leizhen@huawei.com>
Link: https://lore.kernel.org/r/20210528082614.9337-1-thunder.leizhen@huawei.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cc196fed
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment