diff options
| author | Daniel Jordan <[email protected]> | 2020-02-10 13:11:00 -0500 |
|---|---|---|
| committer | Herbert Xu <[email protected]> | 2020-02-22 09:25:42 +0800 |
| commit | 41ccdbfd5427bbbf3ed58b16750113b38fad1780 (patch) | |
| tree | 65901dc6faf1b194cc337a76fa41ca434ce5a5f0 /kernel | |
| parent | fcdba3c33a4dfdc3dc3f2cce46aaf0d6fc1df6c1 (diff) | |
padata: fix uninitialized return value in padata_replace()
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/[email protected]
Reported-by: Geert Uytterhoeven <[email protected]>
Fixes: bbefa1dd6a6d ("crypto: pcrypt - Avoid deadlock by using per-instance padata queues")
Signed-off-by: Daniel Jordan <[email protected]>
Cc: Herbert Xu <[email protected]>
Cc: Steffen Klassert <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Herbert Xu <[email protected]>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/padata.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/padata.c b/kernel/padata.c index 72777c10bb9c..62082597d4a2 100644 --- a/kernel/padata.c +++ b/kernel/padata.c @@ -512,7 +512,7 @@ static int padata_replace_one(struct padata_shell *ps) static int padata_replace(struct padata_instance *pinst) { struct padata_shell *ps; - int err; + int err = 0; pinst->flags |= PADATA_RESET; |