in the loop, if get a descriptor which is not desired type, the buf will be not clean. caller check return length to decide success or not. Signed-off-by: yuan linyu <cugyly@xxxxxxx> --- drivers/usb/core/message.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index e844bb7b5676..03425e6b3da9 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c @@ -640,8 +640,6 @@ int usb_get_descriptor(struct usb_device *dev, unsigned char type, int i; int result; - memset(buf, 0, size); /* Make sure we parse really received data */ - for (i = 0; i < 3; ++i) { /* retry on length 0 or error; some devices are flakey */ result = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), -- 2.17.1