Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1444757 > unrolled thread
| Started by | Christophe JAILLET <christophe.jaillet@wanadoo.fr> |
|---|---|
| First post | 2016-07-16 09:10 +0200 |
| Last post | 2016-07-16 14:40 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] usb: gadget: uvc: Fix return value in case of error Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2016-07-16 09:10 +0200
Re: [PATCH] usb: gadget: uvc: Fix return value in case of error Laurent Pinchart <laurent.pinchart@ideasonboard.com> - 2016-07-16 14:40 +0200
| From | Christophe JAILLET <christophe.jaillet@wanadoo.fr> |
|---|---|
| Date | 2016-07-16 09:10 +0200 |
| Subject | [PATCH] usb: gadget: uvc: Fix return value in case of error |
| Message-ID | <rVrTz-LE-1@gated-at.bofh.it> |
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
[toc] | [next] | [standalone]
| From | Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
|---|---|
| Date | 2016-07-16 14:40 +0200 |
| Message-ID | <rVx2W-3O4-15@gated-at.bofh.it> |
| In reply to | #1444757 |
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
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web