mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 22:14:04 +02:00
bus: fsl-mc: fix error return code in fsl_mc_object_allocate()
[ Upstream commit3d70fb0371] Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes:197f4d6a4a("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>
This commit is contained in:
parent
7524b26f2c
commit
c9144c551f
|
|
@ -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;
|
||||
}
|
||||
|
||||
*new_mc_adev = mc_adev;
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user