Skip to contentSkip to conversation

Patch "libnvdimm, btt: check memory allocation failure" has been added to the 4.13-stable tree

PATCH [email protected] 1 participant 1 message Sep 18, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

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 <[email protected]> know about it.

Quoted 1 line

From ed36b4dba54a421ce5551638f6a9790b2c2116b1 Mon Sep 17 00:00:00 2001

From: Christophe Jaillet <[email protected]>
Date: Sun, 27 Aug 2017 08:30:34 +0200
Subject: libnvdimm, btt: check memory allocation failure

From: Christophe Jaillet <[email protected]>

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")
---
 drivers/nvdimm/btt.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/nvdimm/btt.c +2 -0
@@ -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 [email protected] are

queue-4.13/libnvdimm-btt-check-memory-allocation-failure.patch