libnvdimm, namespace: potential NULL deref on allocation error
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 12 Oct 2016 06:34:29 +0000 (09:34 +0300)
committerDan Williams <dan.j.williams@intel.com>
Wed, 19 Oct 2016 17:35:51 +0000 (10:35 -0700)
commit75d29713b792da4782cadfaa87e802183440694e
tree3d279ed95896399f5b220ac0c554d632432de89a
parent1001354ca34179f3db924eb66672442a173147dc
libnvdimm, namespace: potential NULL deref on allocation error

If the kcalloc() fails then "devs" can be NULL and we dereference it
checking "devs[i]".

Fixes: 1b40e09a1232 ('libnvdimm: blk labels and namespace instantiation')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/nvdimm/namespace_devs.c