avoid crashing at the end of the list
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19217 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
73b7614aa0
commit
c74d27255b
@ -348,11 +348,12 @@ pnp_get_next_attr(device_node_handle node, device_attr_handle *attr)
|
|||||||
next = node->attributes;
|
next = node->attributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
++next->ref_count;
|
if (next)
|
||||||
|
++next->ref_count;
|
||||||
*attr = next;
|
*attr = next;
|
||||||
|
|
||||||
benaphore_unlock(&gNodeLock);
|
benaphore_unlock(&gNodeLock);
|
||||||
return B_OK;
|
return next ? B_OK : B_ENTRY_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user