summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-11-27 09:25:51 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-11-27 09:28:34 +0100
commitfb17be96eed821f60670adf1748afb3d57fe63bb (patch)
tree233193f9e2feb0f32eca1308ad19c0e05e461aea /drivers/staging
parent19e2be77f36cfd5930569cad2d197f31a576cf88 (diff)
downloadlinux-fb17be96eed821f60670adf1748afb3d57fe63bb.tar.gz
linux-fb17be96eed821f60670adf1748afb3d57fe63bb.tar.bz2
linux-fb17be96eed821f60670adf1748afb3d57fe63bb.zip
staging: fsl-mc-bus: fix build warning
error could be unitialized when it is used as a return value in fsl_mc_device_add(). So fix up the warning by properly setting it. Cc: Laurentiu Tudor <laurentiu.tudor@nxp.com> Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/fsl-mc/bus/fsl-mc-bus.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
index f84bc14ce925..f15bab32fb2f 100644
--- a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
+++ b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
@@ -570,6 +570,7 @@ int fsl_mc_device_add(struct fsl_mc_obj_desc *obj_desc,
mc_dev->dev.release = fsl_mc_device_release;
mc_dev->dev.type = fsl_mc_get_device_type(obj_desc->type);
if (!mc_dev->dev.type) {
+ error = -ENODEV;
dev_err(parent_dev, "unknown device type %s\n", obj_desc->type);
goto error_cleanup_dev;
}