aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bus
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-06-05 13:20:24 +0200
committerLi Yang <leoyang.li@nxp.com>2023-06-08 17:56:26 -0500
commite0d43ed6389733c518619ec5b0ad2052352e40a4 (patch)
tree01db932b0a9b11e6261e76a031460d05722c4cf1 /drivers/bus
parent7b1a78babd0d2cd27aa07255dee0c2d7ac0f31e3 (diff)
downloadlinux-e0d43ed6389733c518619ec5b0ad2052352e40a4.tar.gz
bus: fsl-mc: fsl-mc-allocator: Initialize mc_bus_dev before use
Fixes a clang compiler warning: >> drivers/bus/fsl-mc/fsl-mc-allocator.c:108:12: warning: variable 'mc_bus_dev' is uninitialized when used here [-Wuninitialized] dev_err(&mc_bus_dev->dev, "resource mismatch\n"); Fixes: b3134039c5b3 ("bus: fsl-mc: fsl-mc-allocator: Improve error reporting") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202306021936.OktTcMAT-lkp@intel.com/ Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Li Yang <leoyang.li@nxp.com>
Diffstat (limited to 'drivers/bus')
-rw-r--r--drivers/bus/fsl-mc/fsl-mc-allocator.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/bus/fsl-mc/fsl-mc-allocator.c b/drivers/bus/fsl-mc/fsl-mc-allocator.c
index 0ad68099684e6f..991273f956ce71 100644
--- a/drivers/bus/fsl-mc/fsl-mc-allocator.c
+++ b/drivers/bus/fsl-mc/fsl-mc-allocator.c
@@ -103,14 +103,15 @@ static int __must_check fsl_mc_resource_pool_remove_device(struct fsl_mc_device
struct fsl_mc_resource *resource;
int error = -EINVAL;
+ mc_bus_dev = to_fsl_mc_device(mc_dev->dev.parent);
+ mc_bus = to_fsl_mc_bus(mc_bus_dev);
+
resource = mc_dev->resource;
if (!resource || resource->data != mc_dev) {
dev_err(&mc_bus_dev->dev, "resource mismatch\n");
goto out;
}
- mc_bus_dev = to_fsl_mc_device(mc_dev->dev.parent);
- mc_bus = to_fsl_mc_bus(mc_bus_dev);
res_pool = resource->parent_pool;
if (res_pool != &mc_bus->resource_pools[resource->type]) {
dev_err(&mc_bus_dev->dev, "pool mismatch\n");