aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/function/f_rndis.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/function/f_rndis.c')
-rw-r--r--drivers/usb/gadget/function/f_rndis.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/usb/gadget/function/f_rndis.c b/drivers/usb/gadget/function/f_rndis.c
index ddb09dc6d1f2..f13fc6a58565 100644
--- a/drivers/usb/gadget/function/f_rndis.c
+++ b/drivers/usb/gadget/function/f_rndis.c
@@ -802,8 +802,10 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f)
802 802
803 if (rndis->manufacturer && rndis->vendorID && 803 if (rndis->manufacturer && rndis->vendorID &&
804 rndis_set_param_vendor(rndis->config, rndis->vendorID, 804 rndis_set_param_vendor(rndis->config, rndis->vendorID,
805 rndis->manufacturer)) 805 rndis->manufacturer)) {
806 goto fail; 806 status = -EINVAL;
807 goto fail_free_descs;
808 }
807 809
808 /* NOTE: all that is done without knowing or caring about 810 /* NOTE: all that is done without knowing or caring about
809 * the network link ... which is unavailable to this code 811 * the network link ... which is unavailable to this code
@@ -817,10 +819,11 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f)
817 rndis->notify->name); 819 rndis->notify->name);
818 return 0; 820 return 0;
819 821
822fail_free_descs:
823 usb_free_all_descriptors(f);
820fail: 824fail:
821 kfree(f->os_desc_table); 825 kfree(f->os_desc_table);
822 f->os_desc_n = 0; 826 f->os_desc_n = 0;
823 usb_free_all_descriptors(f);
824 827
825 if (rndis->notify_req) { 828 if (rndis->notify_req) {
826 kfree(rndis->notify_req->buf); 829 kfree(rndis->notify_req->buf);