projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
97f8616
)
usb-linux: only cleanup in host_close when host_open was successful.
author
Gerd Hoffmann
<kraxel@redhat.com>
Mon, 6 Jun 2011 07:45:20 +0000
(09:45 +0200)
committer
Gerd Hoffmann
<kraxel@redhat.com>
Tue, 14 Jun 2011 10:56:49 +0000
(12:56 +0200)
usb-linux.c
patch
|
blob
|
history
diff --git
a/usb-linux.c
b/usb-linux.c
index a1b14448e9de387132e29d19b37d3e53cf080b7f..a4dfe5ca171c2c874c79c43cc9aa903deb8cf649 100644
(file)
--- a/
usb-linux.c
+++ b/
usb-linux.c
@@
-1158,9
+1158,9
@@
static int usb_host_open(USBHostDevice *dev, int bus_num,
return 0;
fail:
- dev->fd = -1;
- if (fd != -1) {
-
close(fd)
;
+ if (dev->fd != -1) {
+ close(dev->fd);
+
dev->fd = -1
;
}
return -1;
}
@@
-1169,7
+1169,7
@@
static int usb_host_close(USBHostDevice *dev)
{
int i;
- if (dev->fd == -1) {
+ if (dev->fd == -1
|| !dev->dev.attached
) {
return -1;
}