]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: ath25: Check for kzalloc allocation failure
authorColin Ian King <colin.king@canonical.com>
Thu, 22 Feb 2018 17:50:12 +0000 (17:50 +0000)
committerJames Hogan <jhogan@kernel.org>
Fri, 23 Feb 2018 09:35:54 +0000 (09:35 +0000)
commita47ea67732d5fef45b486148c76f89df7c71d209
treeeb9760274125b673e319c4baebc7006caf948ff5
parent01c5ac84a910c25dba56ecb090defcfafa5f6dc6
MIPS: ath25: Check for kzalloc allocation failure

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: 5ddba6b41e77 ("MIPS: ath25: add board configuration detection")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: <stable@vger.kernel.org> # 3.19+
Patchwork: https://patchwork.linux-mips.org/patch/18657/
Signed-off-by: James Hogan <jhogan@kernel.org>
arch/mips/ath25/board.c