mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
bcache: fix incorrect pointer check
With commit b44db5d1a7
needs to check allocated pointer for failed malloc().
Existing check was actually no checking anything so failing
malloc here would result in segfault (although with very
low chance to ever happen).
This commit is contained in:
parent
d5f3239de4
commit
17802084c9
@ -74,7 +74,7 @@ static struct cb_set *_cb_set_create(unsigned nr)
|
|||||||
unsigned i;
|
unsigned i;
|
||||||
struct cb_set *cbs = malloc(sizeof(*cbs) + nr * sizeof(*cbs->vec));
|
struct cb_set *cbs = malloc(sizeof(*cbs) + nr * sizeof(*cbs->vec));
|
||||||
|
|
||||||
if (!cbs->vec)
|
if (!cbs)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
dm_list_init(&cbs->free);
|
dm_list_init(&cbs->free);
|
||||||
|
Loading…
Reference in New Issue
Block a user