mirror of https://github.com/schoebel/mars
infra: fix list initialization
This commit is contained in:
parent
9d39da8096
commit
ce7dbc07f1
|
@ -707,6 +707,7 @@ int mars_filler(void *__buf, const char *name, int namlen, loff_t offset,
|
|||
|
||||
newpath = NULL;
|
||||
|
||||
INIT_LIST_HEAD(&dent->dent_link);
|
||||
INIT_LIST_HEAD(&dent->brick_list);
|
||||
|
||||
list_add(&dent->dent_link, start);
|
||||
|
|
|
@ -77,13 +77,15 @@ int mars_recv_dent_list(struct mars_socket *sock, struct list_head *anchor)
|
|||
|
||||
//MARS_IO("\n");
|
||||
|
||||
INIT_LIST_HEAD(&dent->dent_link);
|
||||
INIT_LIST_HEAD(&dent->brick_list);
|
||||
|
||||
status = mars_recv_struct(sock, dent, mars_dent_meta);
|
||||
if (status <= 0) {
|
||||
mars_free_dent(dent);
|
||||
goto done;
|
||||
}
|
||||
list_add_tail(&dent->dent_link, anchor);
|
||||
INIT_LIST_HEAD(&dent->brick_list);
|
||||
}
|
||||
done:
|
||||
return status;
|
||||
|
|
Loading…
Reference in New Issue