Skip to content

Commit

Permalink
bus: fsl-mc: fix error return code in fsl_mc_object_allocate()
Browse files Browse the repository at this point in the history
[ Upstream commit 3d70fb0 ]

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 197f4d6 ("staging: fsl-mc: fsl-mc object allocator driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Acked-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Link: https://lore.kernel.org/r/1607068967-31991-1-git-send-email-zhangchangzhong@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Zhang Changzhong authored and gregkh committed Dec 30, 2020
1 parent 9b4f327 commit be4d879
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/bus/fsl-mc/fsl-mc-allocator.c
Expand Up @@ -292,8 +292,10 @@ int __must_check fsl_mc_object_allocate(struct fsl_mc_device *mc_dev,
goto error;

mc_adev = resource->data;
if (!mc_adev)
if (!mc_adev) {
error = -EINVAL;
goto error;
}

mc_adev->consumer_link = device_link_add(&mc_dev->dev,
&mc_adev->dev,
Expand Down

0 comments on commit be4d879

Please sign in to comment.