提交 828f6148 编写于 作者: D Dan Carpenter 提交者: Felipe Balbi

usb: gadget: f_hid: use after free in hidg_alloc_inst()

We free "opts" on the error path and then dereference it.

Fixes: 21a9476a ('usb: gadget: hid: add configfs support')
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 efed421a
......@@ -875,6 +875,7 @@ static struct usb_function_instance *hidg_alloc_inst(void)
kfree(opts);
if (idr_is_empty(&hidg_ida.idr))
ghid_cleanup();
goto unlock;
}
config_group_init_type_name(&opts->func_inst.group, "", &hid_func_type);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册