浏览代码

usb-anchor: Ensure poisened gets initialized to 0

And do so in a way which ensures that any fields added in the future will
also get properly zero-ed.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Hans de Goede 12 年之前
父节点
当前提交
9ef73dbdd0
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      include/linux/usb.h

+ 1 - 0
include/linux/usb.h

@@ -1214,6 +1214,7 @@ struct usb_anchor {
 
 
 static inline void init_usb_anchor(struct usb_anchor *anchor)
 static inline void init_usb_anchor(struct usb_anchor *anchor)
 {
 {
+	memset(anchor, 0, sizeof(*anchor));
 	INIT_LIST_HEAD(&anchor->urb_list);
 	INIT_LIST_HEAD(&anchor->urb_list);
 	init_waitqueue_head(&anchor->wait);
 	init_waitqueue_head(&anchor->wait);
 	spin_lock_init(&anchor->lock);
 	spin_lock_init(&anchor->lock);