提交 4683ae86 编写于 作者: D Dan Carpenter 提交者: Felipe Balbi

usb: gadget: f_rndis: fix an error code on allocation failure

This should be return -ENOMEM.  The current code returns successs.

Fixes: de7a8d2d ('usb: gadget: f_rndis: OS descriptors support')
Acked-by: NAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 f2af7412
...@@ -687,7 +687,7 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f) ...@@ -687,7 +687,7 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f)
f->os_desc_table = kzalloc(sizeof(*f->os_desc_table), f->os_desc_table = kzalloc(sizeof(*f->os_desc_table),
GFP_KERNEL); GFP_KERNEL);
if (!f->os_desc_table) if (!f->os_desc_table)
return PTR_ERR(f->os_desc_table); return -ENOMEM;
f->os_desc_n = 1; f->os_desc_n = 1;
f->os_desc_table[0].os_desc = &rndis_opts->rndis_os_desc; f->os_desc_table[0].os_desc = &rndis_opts->rndis_os_desc;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册