Package: dfu-util
Version: 0.11-3
Severity: normal

Dear Maintainer,

This tool intermittently exits with error code 251 after performing a
successful update. This occurs because `libusb_reset_device()` returns
`LIBUSB_ERROR_NOT_FOUND`, which can happen on some devices. There is a
fix available upstream:
https://sourceforge.net/p/dfu-util/dfu-util/ci/4800abbf917c7e10db495004b4dfbe366b429867

Upstream has not released a version with this fix in the 3 years since
it was committed. I believe debian users could benefit from patching
this fix into unstable:

commit 4800abbf917c7e10db495004b4dfbe366b429867
Author: Francesco Dolcini <[email protected]>
Date:   Tue May 23 09:47:08 2023 +0200

    main: Return success if final reset fails due to device gone

    Return with success when libusb_reset_device() returns
    LIBUSB_ERROR_NOT_FOUND. Without this change 251 (LIBUSB_ERROR_NOT_FOUND
    = -5) would be returned to the shell.

    Signed-off-by: Francesco Dolcini <[email protected]>

diff --git a/src/main.c b/src/main.c
index 962c2a1..25812b4 100644
--- a/src/main.c
+++ b/src/main.c
@@ -781,6 +781,8 @@ status_again:
  if (ret < 0 && ret != LIBUSB_ERROR_NOT_FOUND) {
  warnx("error resetting after download: %s", libusb_error_name(ret));
  ret = EX_IOERR;
+ } else {
+ ret = EX_OK;
  }
  }


Thanks for your attention!

Kor

Reply via email to