LMSDevice: LMS_GetDeviceList() may return a negative number
Change-Id: I855bd8ea6d9cb0f285f4dbbf3bcd09bff4e71044 Fixes: CID#240718
This commit is contained in:
parent
a686277c72
commit
019d698126
|
@ -277,11 +277,12 @@ int LMSDevice::open(const std::string &args, int ref, bool swap_channels)
|
|||
|
||||
LMS_RegisterLogHandler(&lms_log_callback);
|
||||
|
||||
if ((n = LMS_GetDeviceList(NULL)) < 0)
|
||||
if ((rc = LMS_GetDeviceList(NULL)) < 0)
|
||||
LOGC(DDEV, ERROR) << "LMS_GetDeviceList(NULL) failed";
|
||||
LOGC(DDEV, INFO) << "Devices found: " << n;
|
||||
if (n < 1)
|
||||
LOGC(DDEV, INFO) << "Devices found: " << rc;
|
||||
if (rc < 1)
|
||||
return -1;
|
||||
n = rc;
|
||||
|
||||
info_list = new lms_info_str_t[n];
|
||||
|
||||
|
|
Loading…
Reference in New Issue