mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
bcache: fix incorrect pointer check
With commit b44db5d1a7ecc2e8e3cef0852c4397b64ddf0a09 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…
x
Reference in New Issue
Block a user