diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2016-07-16 03:04:40 -0400 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2016-08-11 08:09:46 -0400 |
commit | bd610c5aa9fcc9817d2629274a27aab81aa77cec (patch) | |
tree | b53eee9ac1dbae5c20b642047cf1d2a481556237 | |
parent | 63196e989699ddffb4e3d30ca8c3567d408820f4 (diff) |
usb: gadget: uvc: Fix return value in case of error
If this memory allocation fail, we will return 0, which means success.
Return -ENOMEM instead.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-rw-r--r-- | drivers/usb/gadget/function/uvc_configfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/function/uvc_configfs.c b/drivers/usb/gadget/function/uvc_configfs.c index 66753ba7a42e..31125a4a2658 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, | |||
2023 | if (!data) { | 2023 | if (!data) { |
2024 | kfree(*class_array); | 2024 | kfree(*class_array); |
2025 | *class_array = NULL; | 2025 | *class_array = NULL; |
2026 | ret = PTR_ERR(data); | 2026 | ret = -ENOMEM; |
2027 | goto unlock; | 2027 | goto unlock; |
2028 | } | 2028 | } |
2029 | cl_arr = *class_array; | 2029 | cl_arr = *class_array; |