]> git.baikalelectronics.ru Git - kernel.git/commit
nvmem: sunxi: Check for memory allocation failure
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Wed, 30 Sep 2015 12:36:31 +0000 (13:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 4 Oct 2015 11:09:43 +0000 (12:09 +0100)
commit1bc9cd9df82df00f54beab6fada79725740e3c29
treec2e6b283f38ec0aa7cdf790bae2b941901b41b5e
parent58255266e27e3a88247255a7751669c3a82fe824
nvmem: sunxi: Check for memory allocation failure

The sunxi_sid driver doesn't check for kmalloc return status before
derefencing the returned pointer, which could lead to a NULL pointer
dereference if kmalloc failed. Check for its return code to make sure it
deosn't happen.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvmem/sunxi_sid.c