From: Horia Geantă Date: Mon, 11 Apr 2016 16:56:16 +0000 (-0500) Subject: staging: fsl-mc: return -EINVAL for all fsl_mc_portal_allocate() failures X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=633440505f16f645d22f2d7f8367125ab89123f8;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git staging: fsl-mc: return -EINVAL for all fsl_mc_portal_allocate() failures There are some error paths that allow for a NULL new_mc_io and err = 0 return code. Return -EINVAL instead. Signed-off-by: Horia Geantă Signed-off-by: Stuart Yoder Acked-by: German Rivera Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/fsl-mc/bus/mc-allocator.c b/drivers/staging/fsl-mc/bus/mc-allocator.c index e02d5e554b90..fb08f22a7f9c 100644 --- a/drivers/staging/fsl-mc/bus/mc-allocator.c +++ b/drivers/staging/fsl-mc/bus/mc-allocator.c @@ -293,6 +293,7 @@ int __must_check fsl_mc_portal_allocate(struct fsl_mc_device *mc_dev, if (error < 0) return error; + error = -EINVAL; dpmcp_dev = resource->data; if (WARN_ON(!dpmcp_dev)) goto error_cleanup_resource;