commit | 88e87c568678ab36c997c1c807d97b3b1e7091e6 | [log] [tgz] |
---|---|---|
author | Thomas Heijligen <thomas.heijligen@secunet.com> | Fri Aug 05 17:56:20 2022 +0200 |
committer | Nico Huber <nico.h@gmx.de> | Thu Jan 05 16:35:01 2023 +0000 |
tree | fdd492a475759d50abca6c1fa5b61a7970bee032 | |
parent | 927c1f036fc6b3d9b6cb84c5cacc8e78ec7d28cc [diff] |
tree: Check properly if libusb is initialized The dediprog, developerbox_spi and stlinkv3_spi programmers only check if the libusb_context is not NULL after the initialization. But following the API documentation from libusb, the context is undefined unless the init function returns 0. Fix this by checking the return value instead of the libusb_context to see if the initialization was successful. https://libusb.sourceforge.io/api-1.0/group__libusb__lib.html Change-Id: Ia45ccd3fa2239dfccd821be46a09c86426cb22e5 Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/66460 Original-Reviewed-by: Felix Singer <felixsinger@posteo.net> Reviewed-on: https://review.coreboot.org/c/flashrom-stable/+/71475 Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>