]> sigrok.org Git - libsigrok.git/commit
zeroplus-logic-cube: move USB VID:PID check in scan before device access
authorGerhard Sittig <redacted>
Thu, 28 Sep 2023 18:53:26 +0000 (20:53 +0200)
committerGerhard Sittig <redacted>
Mon, 9 Oct 2023 16:40:05 +0000 (18:40 +0200)
commitfd86380b48f1abff31f523e33c7c12280be1c1f7
tree901d7eee83b71800b63e38aa3409fb8d9fd16591
parentbf8e267b658a50e12f0d5898f9dfdbb284b79efb
zeroplus-logic-cube: move USB VID:PID check in scan before device access

Getting USB strings from faulty devices can be troublesome. Users report
segfaults when unrelated(!) devices get accessed during scan for certain
measurement devices.

Move the VID:PID check during scan before the USB string access. This
avoids access to unrelated devices.

Rephrase the check whether a USB device is a supported model. The
previous implementation's operation is questioned, the loop condition
looked suspicious.

Reported-By: Marek Antoniak <redacted> [the early check]
src/hardware/zeroplus-logic-cube/api.c