Commit 82355e28 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Fix a memcpy call

Not supposed to pass a null ptr to memcpy (even if the size is 0).
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent bbfcb451
......@@ -1161,7 +1161,8 @@ static int add_nlink(struct nlink_table *t, u64 inum, u32 snapshot)
return -ENOMEM;
}
memcpy(d, t->d, t->size * sizeof(t->d[0]));
if (t->d)
memcpy(d, t->d, t->size * sizeof(t->d[0]));
kvfree(t->d);
t->d = d;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment