* [patch 2/2] usb: gadget: printer: use after free in gprinter_alloc_inst()
@ 2015-03-13 9:11 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2015-03-13 9:11 UTC (permalink / raw)
To: kernel-janitors
There was a missing goto so we free "opts" and then dereference it.
Fixes: ee1cd515e889 ('usb: gadget: printer: add configfs support')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/usb/gadget/function/f_printer.c b/drivers/usb/gadget/function/f_printer.c
index caa56de..48882ec 100644
--- a/drivers/usb/gadget/function/f_printer.c
+++ b/drivers/usb/gadget/function/f_printer.c
@@ -1307,6 +1307,7 @@ static struct usb_function_instance *gprinter_alloc_inst(void)
kfree(opts);
if (idr_is_empty(&printer_ida.idr))
gprinter_cleanup();
+ goto unlock;
}
config_group_init_type_name(&opts->func_inst.group, "",
&printer_func_type);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-03-13 9:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-13 9:11 [patch 2/2] usb: gadget: printer: use after free in gprinter_alloc_inst() Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.