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:
Jérôme Duval 2006-11-07 00:51:33 +00:00
parent 73b7614aa0
commit c74d27255b
1 changed files with 3 additions and 2 deletions

View File

@ -348,11 +348,12 @@ pnp_get_next_attr(device_node_handle node, device_attr_handle *attr)
next = node->attributes;
}
++next->ref_count;
if (next)
++next->ref_count;
*attr = next;
benaphore_unlock(&gNodeLock);
return B_OK;
return next ? B_OK : B_ENTRY_NOT_FOUND;
}