Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2bb2077e authored by Dan Carpenter's avatar Dan Carpenter Committed by Felipe Balbi
Browse files

usb: gadget: printer: use after free in gprinter_alloc_inst()



There was a missing goto so we free "opts" and then dereference it.

Fixes: ee1cd515 ('usb: gadget: printer: add configfs support')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent fdb51e3d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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);