Commit da13ea25 authored by Christopher Obbard's avatar Christopher Obbard Committed by Zheng Zengkai
Browse files

um: random: Don't initialise hwrng struct with zero

stable inclusion
from stable-v5.10.137
commit 993cd16211806666a649bbad2e507413a4f80864
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I60PLB

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=993cd16211806666a649bbad2e507413a4f80864



--------------------------------

[ Upstream commit 9e70cbd1 ]

Initialising the hwrng struct with zeros causes a
compile-time sparse warning:

 $ ARCH=um make -j10 W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
 ...
 CHECK   arch/um/drivers/random.c
 arch/um/drivers/random.c:31:31: sparse: warning: Using plain integer as NULL pointer

Fix the warning by not initialising the hwrng struct
with zeros as it is initialised anyway during module
init.

Fixes: 72d3e093 ("um: random: Register random as hwrng-core device")
Reported-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarChristopher Obbard <chris.obbard@collabora.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: default avatarWei Li <liwei391@huawei.com>
parent 040467cd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment