* [PATCH] usb: gadget: uvc: Fix return value in case of error
@ 2016-07-16 7:04 ` Christophe JAILLET
0 siblings, 0 replies; 4+ messages in thread
From: Christophe JAILLET @ 2016-07-16 7:04 UTC (permalink / raw)
To: laurent.pinchart, balbi, gregkh
Cc: linux-usb, linux-kernel, kernel-janitors, Christophe JAILLET
If this memory allocation fail, we will return 0, which means success.
Return -ENOMEM instead.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/usb/gadget/function/uvc_configfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/function/uvc_configfs.c b/drivers/usb/gadget/function/uvc_configfs.c
index 66753ba..31125a4 100644
--- a/drivers/usb/gadget/function/uvc_configfs.c
+++ b/drivers/usb/gadget/function/uvc_configfs.c
@@ -2023,7 +2023,7 @@ static int uvcg_streaming_class_allow_link(struct config_item *src,
if (!data) {
kfree(*class_array);
*class_array = NULL;
- ret = PTR_ERR(data);
+ ret = -ENOMEM;
goto unlock;
}
cl_arr = *class_array;
--
2.7.4
---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] usb: gadget: uvc: Fix return value in case of error
@ 2016-07-16 7:04 ` Christophe JAILLET
0 siblings, 0 replies; 4+ messages in thread
From: Christophe JAILLET @ 2016-07-16 7:04 UTC (permalink / raw)
To: laurent.pinchart, balbi, gregkh
Cc: linux-usb, linux-kernel, kernel-janitors, Christophe JAILLET
If this memory allocation fail, we will return 0, which means success.
Return -ENOMEM instead.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/usb/gadget/function/uvc_configfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/function/uvc_configfs.c b/drivers/usb/gadget/function/uvc_configfs.c
index 66753ba..31125a4 100644
--- a/drivers/usb/gadget/function/uvc_configfs.c
+++ b/drivers/usb/gadget/function/uvc_configfs.c
@@ -2023,7 +2023,7 @@ static int uvcg_streaming_class_allow_link(struct config_item *src,
if (!data) {
kfree(*class_array);
*class_array = NULL;
- ret = PTR_ERR(data);
+ ret = -ENOMEM;
goto unlock;
}
cl_arr = *class_array;
--
2.7.4
---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] usb: gadget: uvc: Fix return value in case of error
2016-07-16 7:04 ` Christophe JAILLET
@ 2016-07-16 12:36 ` Laurent Pinchart
-1 siblings, 0 replies; 4+ messages in thread
From: Laurent Pinchart @ 2016-07-16 12:36 UTC (permalink / raw)
To: Christophe JAILLET
Cc: balbi, gregkh, linux-usb, linux-kernel, kernel-janitors
Hi Christophe,
Thank you for the patch.
On Saturday 16 Jul 2016 09:04:40 Christophe JAILLET wrote:
> If this memory allocation fail, we will return 0, which means success.
> Return -ENOMEM instead.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/usb/gadget/function/uvc_configfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/function/uvc_configfs.c
> b/drivers/usb/gadget/function/uvc_configfs.c index 66753ba..31125a4 100644
> --- a/drivers/usb/gadget/function/uvc_configfs.c
> +++ b/drivers/usb/gadget/function/uvc_configfs.c
> @@ -2023,7 +2023,7 @@ static int uvcg_streaming_class_allow_link(struct
> config_item *src, if (!data) {
> kfree(*class_array);
> *class_array = NULL;
> - ret = PTR_ERR(data);
> + ret = -ENOMEM;
> goto unlock;
> }
> cl_arr = *class_array;
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] usb: gadget: uvc: Fix return value in case of error
@ 2016-07-16 12:36 ` Laurent Pinchart
0 siblings, 0 replies; 4+ messages in thread
From: Laurent Pinchart @ 2016-07-16 12:36 UTC (permalink / raw)
To: Christophe JAILLET
Cc: balbi, gregkh, linux-usb, linux-kernel, kernel-janitors
Hi Christophe,
Thank you for the patch.
On Saturday 16 Jul 2016 09:04:40 Christophe JAILLET wrote:
> If this memory allocation fail, we will return 0, which means success.
> Return -ENOMEM instead.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/usb/gadget/function/uvc_configfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/function/uvc_configfs.c
> b/drivers/usb/gadget/function/uvc_configfs.c index 66753ba..31125a4 100644
> --- a/drivers/usb/gadget/function/uvc_configfs.c
> +++ b/drivers/usb/gadget/function/uvc_configfs.c
> @@ -2023,7 +2023,7 @@ static int uvcg_streaming_class_allow_link(struct
> config_item *src, if (!data) {
> kfree(*class_array);
> *class_array = NULL;
> - ret = PTR_ERR(data);
> + ret = -ENOMEM;
> goto unlock;
> }
> cl_arr = *class_array;
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-07-16 12:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-16 7:04 [PATCH] usb: gadget: uvc: Fix return value in case of error Christophe JAILLET
2016-07-16 7:04 ` Christophe JAILLET
2016-07-16 12:36 ` Laurent Pinchart
2016-07-16 12:36 ` Laurent Pinchart
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.