]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: OCTEON: irq: Fix potential NULL pointer dereference
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Tue, 22 Jan 2019 20:18:42 +0000 (14:18 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Apr 2020 08:50:12 +0000 (10:50 +0200)
commitd83f741736ac6ec72e498f931e6a4eb2453cacd2
tree851324c3680403669c97318e3f1dbf3d85e98411
parent5f3078a5e70086821b0c81695edf65d6ff6fb434
MIPS: OCTEON: irq: Fix potential NULL pointer dereference

commit 4742061c29792f396a6d70d4161588c8cd30a186 upstream.

There is a potential NULL pointer dereference in case kzalloc()
fails and returns NULL.

Fix this by adding a NULL check on *cd*

This bug was detected with the help of Coccinelle.

Fixes: c736ca46ffa0 ("MIPS: OCTEON: irq: add CIB and other fixes")
Cc: stable@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/mips/cavium-octeon/octeon-irq.c