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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Mar 2018 09:54:31 +0000 (10:54 +0100)
commite06fe592577174c01bb194866bb2c7d253f51397
treee27268eecc71aef71034fe13e6cc31c5df0d6417
parent26f1a4666090145a8b4f5d43f65d7fc3be2594a1
MIPS: ath25: Check for kzalloc allocation failure

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")
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/mips/ath25/board.c