We want to check here if we added something to the list, not if the
function argument was valid. Problem spotted by Coverity, CID 50754.
Signed-off-by: Wolfram Sang <redacted>
DBG("%s: %s\n", __func__, entry.d_name);
*list = list_append(*list, name);
- if (!list) {
+ if (!*list) {
SET_ERROR(ret, SP_ERR_MEM, "List append failed");
break;
}
}
DEBUG_FMT("Found port %s", name);
*list = list_append(*list, name);
- if (!list) {
+ if (!*list) {
SET_ERROR(ret, SP_ERR_MEM, "List append failed");
break;
}