[PATCH 1/2] usb-anchor: Ensure poisened gets initialized to 0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 include/linux/usb.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/usb.h b/include/linux/usb.h
index 8ad6e7e..2b5d08b 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -1217,6 +1217,7 @@ struct usb_anchor {
 
 static inline void init_usb_anchor(struct usb_anchor *anchor)
 {
+	memset(anchor, 0, sizeof(*anchor));
 	INIT_LIST_HEAD(&anchor->urb_list);
 	init_waitqueue_head(&anchor->wait);
 	spin_lock_init(&anchor->lock);
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux