mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-01 11:28:02 +02:00
core/wimax: avoid printing wrong error message in iwmx_sdk_addremove_cb
deviceid_to_index returns -1 when the deviceid was not found. Assiging it to an unsigned variable is wrong and would result in printing an error message when trying to remove the non existing index. Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
parent
8fe613b4f0
commit
1f71972998
1 changed files with 4 additions and 3 deletions
|
|
@ -1430,9 +1430,10 @@ static void iwmx_sdk_addremove_cb(WIMAX_API_DEVICE_ID *devid,
|
|||
iwmx_sdk_dev_add(devid->deviceIndex, dev->deviceIndex, dev->deviceName);
|
||||
} else {
|
||||
/* Remove the device from our internal list */
|
||||
cnt = deviceid_to_index(devid);
|
||||
if (cnt >= 0)
|
||||
iwmx_sdk_dev_rm(cnt);
|
||||
int idx = deviceid_to_index(devid);
|
||||
|
||||
if (idx >= 0)
|
||||
iwmx_sdk_dev_rm(idx);
|
||||
}
|
||||
|
||||
out:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue