提交 238b68e6 编写于 作者: E Emiliano Ingrassia 提交者: Xie XiuQi

usb: core: urb: fix URB structure initialization function

commit 1cd17f7f0def31e3695501c4f86cd3faf8489840 upstream.

Explicitly initialize URB structure urb_list field in usb_init_urb().
This field can be potentially accessed uninitialized and its
initialization is coherent with the usage of list_del_init() in
usb_hcd_unlink_urb_from_ep() and usb_giveback_urb_bh() and its
explicit initialization in usb_hcd_submit_urb() error path.
Signed-off-by: NEmiliano Ingrassia <ingrassia@epigenesys.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20191127160355.GA27196@ingrassia.epigenesys.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 83691c5f
...@@ -45,6 +45,7 @@ void usb_init_urb(struct urb *urb) ...@@ -45,6 +45,7 @@ void usb_init_urb(struct urb *urb)
if (urb) { if (urb) {
memset(urb, 0, sizeof(*urb)); memset(urb, 0, sizeof(*urb));
kref_init(&urb->kref); kref_init(&urb->kref);
INIT_LIST_HEAD(&urb->urb_list);
INIT_LIST_HEAD(&urb->anchor_list); INIT_LIST_HEAD(&urb->anchor_list);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册