summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/function/f_rndis.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2016-02-26 13:02:14 +0300
committerChristoph Hellwig <hch@lst.de>2016-03-06 18:11:24 +0300
commit1ae1602de028acaa42a0f6ff18d19756f8e825c6 (patch)
tree3370e5c29945370f62b9c72adeec587ed102d048 /drivers/usb/gadget/function/f_rndis.c
parentb1f1a29d8fb5eeaeec2cafe4c62f276d950c015b (diff)
downloadlinux-1ae1602de028acaa42a0f6ff18d19756f8e825c6.tar.xz
configfs: switch ->default groups to a linked list
Replace the current NULL-terminated array of default groups with a linked list. This gets rid of lots of nasty code to size and/or dynamically allocate the array. While we're at it also provide a conveniant helper to remove the default groups. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Felipe Balbi <balbi@kernel.org> [drivers/usb/gadget] Acked-by: Joel Becker <jlbec@evilplan.org> Acked-by: Nicholas Bellinger <nab@linux-iscsi.org> Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
Diffstat (limited to 'drivers/usb/gadget/function/f_rndis.c')
-rw-r--r--drivers/usb/gadget/function/f_rndis.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/usb/gadget/function/f_rndis.c b/drivers/usb/gadget/function/f_rndis.c
index e587767e374c..f577eec88f8c 100644
--- a/drivers/usb/gadget/function/f_rndis.c
+++ b/drivers/usb/gadget/function/f_rndis.c
@@ -889,7 +889,6 @@ static void rndis_free_inst(struct usb_function_instance *f)
free_netdev(opts->net);
}
- kfree(opts->rndis_os_desc.group.default_groups); /* single VLA chunk */
kfree(opts);
}
@@ -916,10 +915,10 @@ static struct usb_function_instance *rndis_alloc_inst(void)
descs[0] = &opts->rndis_os_desc;
names[0] = "rndis";
- usb_os_desc_prepare_interf_dir(&opts->func_inst.group, 1, descs,
- names, THIS_MODULE);
config_group_init_type_name(&opts->func_inst.group, "",
&rndis_func_type);
+ usb_os_desc_prepare_interf_dir(&opts->func_inst.group, 1, descs,
+ names, THIS_MODULE);
return &opts->func_inst;
}