aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/f_eem.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/f_eem.c')
-rw-r--r--drivers/usb/gadget/f_eem.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/gadget/f_eem.c b/drivers/usb/gadget/f_eem.c
index 90ee8022e8d8..d00392d879db 100644
--- a/drivers/usb/gadget/f_eem.c
+++ b/drivers/usb/gadget/f_eem.c
@@ -593,8 +593,11 @@ static struct usb_function_instance *eem_alloc_inst(void)
593 mutex_init(&opts->lock); 593 mutex_init(&opts->lock);
594 opts->func_inst.free_func_inst = eem_free_inst; 594 opts->func_inst.free_func_inst = eem_free_inst;
595 opts->net = gether_setup_default(); 595 opts->net = gether_setup_default();
596 if (IS_ERR(opts->net)) 596 if (IS_ERR(opts->net)) {
597 return ERR_CAST(opts->net); 597 struct net_device *net = opts->net;
598 kfree(opts);
599 return ERR_CAST(net);
600 }
598 601
599 config_group_init_type_name(&opts->func_inst.group, "", &eem_func_type); 602 config_group_init_type_name(&opts->func_inst.group, "", &eem_func_type);
600 603