bcachefs: Fix a memcpy call
Not supposed to pass a null ptr to memcpy (even if the size is 0). Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
parent
bbfcb4519d
commit
82355e2882
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user