Skip to content

Commit

Permalink
usb: gadget: f_rndis: fix an error code on allocation failure
Browse files Browse the repository at this point in the history
This should be return -ENOMEM.  The current code returns successs.

Fixes: de7a8d2 ('usb: gadget: f_rndis: OS descriptors support')
Acked-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Dan Carpenter authored and Felipe Balbi committed Jun 19, 2014
1 parent f2af741 commit 4683ae8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/gadget/f_rndis.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f)
f->os_desc_table = kzalloc(sizeof(*f->os_desc_table),
GFP_KERNEL);
if (!f->os_desc_table)
return PTR_ERR(f->os_desc_table);
return -ENOMEM;
f->os_desc_n = 1;
f->os_desc_table[0].os_desc = &rndis_opts->rndis_os_desc;
}
Expand Down

0 comments on commit 4683ae8

Please sign in to comment.