git://developer.intra2net.com
/
libftdi
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
de40c60
)
Increment the refcount on devices we return from ftdi_usb_find_all()
author
Uwe Bonnes
<bon@elektron.ikp.physik.tu-darmstadt.de>
Tue, 28 Jun 2011 14:08:20 +0000 (16:08 +0200)
committer
Thomas Jarosch
<thomas.jarosch@intra2net.com>
Tue, 28 Jun 2011 14:40:01 +0000 (16:40 +0200)
src/ftdi.c
patch
|
blob
|
blame
|
history
diff --git
a/src/ftdi.c
b/src/ftdi.c
index
e3862a8
..
57730d9
100644
(file)
--- a/
src/ftdi.c
+++ b/
src/ftdi.c
@@
-299,7
+299,7
@@
int ftdi_usb_find_all(struct ftdi_context *ftdi, struct ftdi_device_list **devli
(*curdev)->next = NULL;
(*curdev)->dev = dev;
-
+ libusb_ref_device(dev);
curdev = &(*curdev)->next;
count++;
}
@@
-320,6
+320,7
@@
void ftdi_list_free(struct ftdi_device_list **devlist)
for (curdev = *devlist; curdev != NULL;)
{
next = curdev->next;
+ libusb_unref_device(curdev->dev);
free(curdev);
curdev = next;
}