* [PATCH] bus: fsl-mc: fix error return code in fsl_mc_object_allocate()
@ 2020-12-04 8:02 Zhang Changzhong
2020-12-04 10:44 ` Laurentiu Tudor
0 siblings, 1 reply; 2+ messages in thread
From: Zhang Changzhong @ 2020-12-04 8:02 UTC (permalink / raw)
To: Stuart Yoder, Laurentiu Tudor, Alexander Graf, J. German Rivera,
Greg Kroah-Hartman
Cc: Zhang Changzhong, linux-kernel
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>
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
---
drivers/bus/fsl-mc/fsl-mc-allocator.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/bus/fsl-mc/fsl-mc-allocator.c b/drivers/bus/fsl-mc/fsl-mc-allocator.c
index e71a6f5..2d7c764 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;
+ }
mc_adev->consumer_link = device_link_add(&mc_dev->dev,
&mc_adev->dev,
--
2.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] bus: fsl-mc: fix error return code in fsl_mc_object_allocate()
2020-12-04 8:02 [PATCH] bus: fsl-mc: fix error return code in fsl_mc_object_allocate() Zhang Changzhong
@ 2020-12-04 10:44 ` Laurentiu Tudor
0 siblings, 0 replies; 2+ messages in thread
From: Laurentiu Tudor @ 2020-12-04 10:44 UTC (permalink / raw)
To: Zhang Changzhong, Stuart Yoder, Alexander Graf, Greg Kroah-Hartman
Cc: linux-kernel
On 12/4/2020 10:02 AM, Zhang Changzhong wrote:
> 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>
> Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Acked-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
---
Best Regards, Laurentiu
> ---
> drivers/bus/fsl-mc/fsl-mc-allocator.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/bus/fsl-mc/fsl-mc-allocator.c b/drivers/bus/fsl-mc/fsl-mc-allocator.c
> index e71a6f5..2d7c764 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;
> + }
>
> mc_adev->consumer_link = device_link_add(&mc_dev->dev,
> &mc_adev->dev,
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-04 10:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04 8:02 [PATCH] bus: fsl-mc: fix error return code in fsl_mc_object_allocate() Zhang Changzhong
2020-12-04 10:44 ` Laurentiu Tudor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).