guard against device that went missing in claim/release interface

- add test for missing devices in claim or release
- changlog entry for all the sanei_usb work
merge-requests/1/head
Stphane Voltz 2013-03-10 22:06:52 +01:00
rodzic 2a66940c6b
commit 5a1d5a62ee
2 zmienionych plików z 20 dodań i 1 usunięć

Wyświetl plik

@ -1,3 +1,13 @@
2013-03-24 Stéphane Voltz <stef.dev@free.fr>
backend/genesys.c: make use of the new sanei_usb_scan_devices function
in sane_get_devices.
2013-03-24 Stéphane Voltz <stef.dev@free.fr>
* sanei/sanei_usb.c include/sane/sanei_usb.h:
separate device search logic from usb init by creating a
sanei_usb_scan_devices. Add a sanei_usb_exit function to free
allocated resources by sanei_usb_init.
2013-03-21 Rolf Bensch <rolf at bensch hyphen online dot de>
* backend/pixma_mp150.c, doc/descriptions/pixma.desc, doc/sane-pixma.man:
New scanner Canon Pixma MP230 reported by Petar Dodev.

Wyświetl plik

@ -2899,6 +2899,11 @@ sanei_usb_claim_interface (SANE_Int dn, SANE_Int interface_number)
dn);
return SANE_STATUS_INVAL;
}
if (devices[dn].missing)
{
DBG (1, "sanei_usb_claim_interface: device dn=%d is missing\n", dn);
return SANE_STATUS_INVAL;
}
DBG (5, "sanei_usb_claim_interface: interface_number = %d\n", interface_number);
@ -2962,7 +2967,11 @@ sanei_usb_release_interface (SANE_Int dn, SANE_Int interface_number)
dn);
return SANE_STATUS_INVAL;
}
if (devices[dn].missing)
{
DBG (1, "sanei_usb_release_interface: device dn=%d is missing\n", dn);
return SANE_STATUS_INVAL;
}
DBG (5, "sanei_usb_release_interface: interface_number = %d\n", interface_number);
if (devices[dn].method == sanei_usb_method_scanner_driver)