diff options
author | Zhang Changzhong <zhangchangzhong@huawei.com> | 2020-12-04 11:02:47 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-12-30 13:26:02 +0300 |
commit | c9144c551fb0b5ecc89e5a728bda90e03345efde (patch) | |
tree | f24fe8b618d1e15280492f51e69e254b4ed86105 /drivers/bus | |
parent | 7524b26f2c580127ad3f795b5084b63b07b10cd8 (diff) | |
download | linux-c9144c551fb0b5ecc89e5a728bda90e03345efde.tar.xz |
bus: fsl-mc: fix error return code in fsl_mc_object_allocate()
[ Upstream commit 3d70fb03711c37bc64e8e9aea5830f498835f6bf ]
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.
Fixes: 197f4d6a4a00 ("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>
Diffstat (limited to 'drivers/bus')
-rw-r--r-- | drivers/bus/fsl-mc/fsl-mc-allocator.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/bus/fsl-mc/fsl-mc-allocator.c b/drivers/bus/fsl-mc/fsl-mc-allocator.c index e906ecfe23dd..9cb0733a0399 100644 --- a/drivers/bus/fsl-mc/fsl-mc-allocator.c +++ b/drivers/bus/fsl-mc/fsl-mc-allocator.c @@ -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; |