Skip to content

Commit fb2f676

Browse files
danieljordan10gregkh
authored andcommitted
padata: fix uninitialized return value in padata_replace()
[ Upstream commit 41ccdbf ] According to Geert's report[0], kernel/padata.c: warning: 'err' may be used uninitialized in this function [-Wuninitialized]: => 539:2 Warning is seen only with older compilers on certain archs. The runtime effect is potentially returning garbage down the stack when padata's cpumasks are modified before any pcrypt requests have run. Simplest fix is to initialize err to the success value. [0] http://lkml.kernel.org/r/20200210135506.11536-1-geert@linux-m68k.org Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Fixes: bbefa1d ("crypto: pcrypt - Avoid deadlock by using per-instance padata queues") Signed-off-by: Daniel Jordan <daniel.m.jordan@oracle.com> Cc: Herbert Xu <herbert@gondor.apana.org.au> Cc: Steffen Klassert <steffen.klassert@secunet.com> Cc: linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 0af4216 commit fb2f676

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎kernel/padata.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ static int padata_replace(struct padata_instance *pinst)
516516
{
517517
int notification_mask = 0;
518518
struct padata_shell *ps;
519-
int err;
519+
int err = 0;
520520

521521
pinst->flags |= PADATA_RESET;
522522

0 commit comments

Comments
 (0)