diff options
author | Nathan Chancellor <natechancellor@gmail.com> | 2019-03-07 23:56:51 +0100 |
---|---|---|
committer | Matthias Brugger <matthias.bgg@gmail.com> | 2019-04-12 21:57:49 +0200 |
commit | 89e28da82836530f1ac7a3a32fecc31f22d79b3e (patch) | |
tree | 1d3e970a9343d6e9b1fb230ddefac02b39459677 /drivers/soc/mediatek | |
parent | soc: mediatek: pwrap: add support for MT8516 pwrap (diff) | |
download | linux-89e28da82836530f1ac7a3a32fecc31f22d79b3e.tar.xz linux-89e28da82836530f1ac7a3a32fecc31f22d79b3e.zip |
soc: mediatek: pwrap: Zero initialize rdata in pwrap_init_cipher
When building with -Wsometimes-uninitialized, Clang warns:
drivers/soc/mediatek/mtk-pmic-wrap.c:1358:6: error: variable 'rdata' is
used uninitialized whenever '||' condition is true
[-Werror,-Wsometimes-uninitialized]
If pwrap_write returns non-zero, pwrap_read will not be called to
initialize rdata, meaning that we will use some random uninitialized
stack value in our print statement. Zero initialize rdata in case this
happens.
Link: https://github.com/ClangBuiltLinux/linux/issues/401
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
Diffstat (limited to 'drivers/soc/mediatek')
-rw-r--r-- | drivers/soc/mediatek/mtk-pmic-wrap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c index 73f0be0567bd..c4449a163991 100644 --- a/drivers/soc/mediatek/mtk-pmic-wrap.c +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c @@ -1371,7 +1371,7 @@ static bool pwrap_is_pmic_cipher_ready(struct pmic_wrapper *wrp) static int pwrap_init_cipher(struct pmic_wrapper *wrp) { int ret; - u32 rdata; + u32 rdata = 0; pwrap_writel(wrp, 0x1, PWRAP_CIPHER_SWRST); pwrap_writel(wrp, 0x0, PWRAP_CIPHER_SWRST); |