Fix parse of usb device description with multiple configurations
commit9b81fbdbb0cc930aacec343c6ab37adfd60c9e76
authorCao,Bing Bu <mars@linux.vnet.ibm.com>
Tue, 13 Dec 2011 01:22:20 +0000 (13 09:22 +0800)
committerJustin M. Forbes <jforbes@redhat.com>
Tue, 10 Jan 2012 15:45:14 +0000 (10 09:45 -0600)
treed354189d821483b4b96fb08eb23ce5744b018225
parent7e2191ae9898cc957a3d1991aff0e40f2e0f44a4
Fix parse of usb device description with multiple configurations

Changed From V1:
Use DPRINTF instead of fprintf,because it is not an error.

When testing ipod on QEMU by He Jie Xu<xuhj@linux.vnet.ibm.com>,qemu made a assertion.
We found that the ipod with 2 configurations,and the usb-linux did not parse the descriptor correctly.
The descr_len returned is the total length of the all configurations,not one configuration.
The older version will through the other configurations instead of skip,continue parsing the descriptor of interfaces/endpoints in other configurations,then went wrong.

This patch will put the configuration descriptor parse in loop outside and dispel the other configurations not requested.

Signed-off-by: Cao,Bing Bu <mars@linux.vnet.ibm.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb-linux.c