powerpc/fsl: fix compiler warning in fsl_wakeup_sys_init()
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Mar 2023 18:16:06 +0000 (20:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Mar 2023 06:23:54 +0000 (08:23 +0200)
commitcf34b880a66e3581300b997df25a7c12f7cfe7d7
treee0baf25bbcd6a18eafac2bd35ea652c43d9058db
parent5c9a27df4eb9a402770d5547af255a765e1c10ac
powerpc/fsl: fix compiler warning in fsl_wakeup_sys_init()

Commit c93bd175414a ("powerpc/fsl: move to use bus_get_dev_root()")
changed to use bus_get_dev_root() but didn't consider that the function
can fail and return an uninitialized value of ret (hint, the function
can never fail, but the compiler doesn't know that.)

Fix this up by setting ret to -EINVAL just in case something really goes
wrong with the call to bus_get_dev_root().

Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: linuxppc-dev@lists.ozlabs.org
Fixes: c93bd175414a ("powerpc/fsl: move to use bus_get_dev_root()")
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/oe-kbuild-all/202303280045.4oaaezcn-lkp@intel.com/
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20230327181606.1424846-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/sysdev/fsl_mpic_timer_wakeup.c