Skip to contentSkip to conversation

Patch "MIPS: ath25: Check for kzalloc allocation failure" has been added to the 4.15-stable tree

PATCH [email protected] 1 participant 1 message Mar 12, 2018

Subsystems (2)
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

MIPS: ath25: Check for kzalloc allocation failure

to the 4.15-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:
mips-ath25-check-for-kzalloc-allocation-failure.patch
and it can be found in the queue-4.15 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 1b22b4b28fd5fbc51855219e3238b3ab81da8466 Mon Sep 17 00:00:00 2001

From: Colin Ian King <[email protected]>
Date: Thu, 22 Feb 2018 17:50:12 +0000
Subject: MIPS: ath25: Check for kzalloc allocation failure

From: Colin Ian King <[email protected]>

commit 1b22b4b28fd5fbc51855219e3238b3ab81da8466 upstream.

Currently there is no null check on a failed allocation of board_data, and hence a null pointer dereference will occurr. Fix this by checking for the out of memory null pointer.

Fixes a7473717483e ("MIPS: ath25: add board configuration detection")
Cc Ralf Baechle <[email protected]>
Cc <[email protected]> # 3.19+

Patchwork: https://patchwork.linux-mips.org/patch/18657/

---
 arch/mips/ath25/board.c |    2 ++
 1 file changed, 2 insertions(+)
arch/mips/ath25/board.c +2 -0
@@ -135,6 +135,8 @@ int __init ath25_find_config(phys_addr_t
 	}
 
 	board_data = kzalloc(BOARD_CONFIG_BUFSZ, GFP_KERNEL);
+	if (!board_data)
+		goto error;
 	ath25_board.config = (struct ath25_boarddata *)board_data;
 	memcpy_fromio(board_data, bcfg, 0x100);
 	if (broken_boarddata) {

Patches currently in stable-queue which might be from [email protected] are

queue-4.15/mips-ath25-check-for-kzalloc-allocation-failure.patch queue-4.15/mips-octeon-irq-check-for-null-return-on-kzalloc-allocation.patch