[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 05/14] usb-linux: Don't call usb_host_close when
From: |
Hans de Goede |
Subject: |
Re: [Qemu-devel] [PATCH 05/14] usb-linux: Don't call usb_host_close when usb_host_open fails |
Date: |
Wed, 01 Jun 2011 16:33:28 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc15 Lightning/1.0b2 Thunderbird/3.1.10 |
Hi,
On 06/01/2011 02:22 PM, Gerd Hoffmann wrote:
What bug you are trying to fix here?
Nothing in particular, while looking at some other
stuff I noticed that we have the following sequence,
which is wrong:
usb_host_open called
usb_host_open calls usb_host_claim_interfaces
usb_host_claim_interfaces calls do_disconnect because of failure
do_disconnect calls usb_host_close
usb_host_close iterates over endpoints, but usb_linux_update_endp_table
has not been called to initialize the endpoints at this points
usb_host_close calls usb_device_detach, but not attached yet
usb_host_close does an not needed ioctl(dev->fd, USBDEVFS_RESET);
usb_host_closes the fd
usb_host_open jumps to fail, closes the fd *again*
All of this is does not lead to any real user visible bugs,
but from a code flow pov it is wrong.
Regards,
Hans