summaryrefslogtreecommitdiff
path: root/libsysfs/dlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'libsysfs/dlist.c')
-rw-r--r--libsysfs/dlist.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libsysfs/dlist.c b/libsysfs/dlist.c
index 942eccb48c..b440d65bed 100644
--- a/libsysfs/dlist.c
+++ b/libsysfs/dlist.c
@@ -74,14 +74,14 @@ inline void *_dlist_mark_move(Dlist *list,int direction)
{
if(direction)
{
- if( list->marker->next!=NULL)
+ if( list->marker && list->marker->next!=NULL)
list->marker=list->marker->next;
else
return(NULL);
}
else
{
- if( list->marker->prev!=NULL)
+ if( list->marker && list->marker->prev!=NULL)
list->marker=list->marker->prev;
else
return(NULL);