[PATCH dfu-util] main: Check return value on all libusb calls

2011-11-16 Thread Tormod Volden
From: Tormod Volden Thanks to Uwe Bonnes and Satz Klauer for pointing it out. Also adjusted a couple of related diagnostic messages. Signed-off-by: Tormod Volden --- Uwe once actually sent me a patch for what Satz pointed out, but it needed to be refreshed for the current code. Cheers, Tormo

dfu_util: bugfix for crash

2011-11-16 Thread Satz Klauer
Hi, I found a small bug in dfu_util, file main.c function find_dfu_if() line 86: There a function libusb_get_config_descriptor(dev, cfg_idx, &cfg); is called without checking the return code. In case it fails cfg is invalid and will lead to an crash some lines later. Something like rc=libusb_ge

Re: [PATCH dfu-util] main: Simplify --detach handling by reusing existing code

2011-11-16 Thread Stefan Schmidt
Hello. On Sun, 2011-11-13 at 23:02, Tormod Volden wrote: > From: Tormod Volden > > I have some issues with the recent --detach option addition: > * It duplicates the existing detach code > * It sends requests to an interface without claiming it first > * It resets the device without checking bit

Re: [PATCH dfu-util] dfuse: Add a reference to ST's protocol description

2011-11-16 Thread Stefan Schmidt
Hello. On Sun, 2011-11-13 at 23:05, Tormod Volden wrote: > From: Tormod Volden > > Signed-off-by: Tormod Volden > --- > src/dfuse.c |3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/src/dfuse.c b/src/dfuse.c > index f091bda..c5807e0 100644 > --- a/src/dfuse.c > ++