This is a note to let you know that I've just added the patch titled libnvdimm, btt: check memory allocation failure to the 4.13-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: libnvdimm-btt-check-memory-allocation-failure.patch and it can be found in the queue-4.13 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From ed36b4dba54a421ce5551638f6a9790b2c2116b1 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet <christophe.jaillet@xxxxxxxxxx> Date: Sun, 27 Aug 2017 08:30:34 +0200 Subject: libnvdimm, btt: check memory allocation failure From: Christophe Jaillet <christophe.jaillet@xxxxxxxxxx> commit ed36b4dba54a421ce5551638f6a9790b2c2116b1 upstream. Check memory allocation failures and return -ENOMEM in such cases, as already done few lines below for another memory allocation. This avoids NULL pointers dereference. Fixes: 14e494542636 ("libnvdimm, btt: BTT updates for UEFI 2.7 format") Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx> Reviewed-by: Vishal Verma <vishal.l.verma@xxxxxxxxx> Signed-off-by: Dan Williams <dan.j.williams@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/nvdimm/btt.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/nvdimm/btt.c +++ b/drivers/nvdimm/btt.c @@ -1429,6 +1429,8 @@ int nvdimm_namespace_attach_btt(struct n } btt_sb = devm_kzalloc(&nd_btt->dev, sizeof(*btt_sb), GFP_KERNEL); + if (!btt_sb) + return -ENOMEM; /* * If this returns < 0, that is ok as it just means there wasn't Patches currently in stable-queue which might be from christophe.jaillet@xxxxxxxxxx are queue-4.13/libnvdimm-btt-check-memory-allocation-failure.patch