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:
Thomas Haller 2013-12-13 17:02:17 +01:00
parent 8fe613b4f0
commit 1f71972998

View file

@ -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: