]> git.baikalelectronics.ru Git - kernel.git/commit
misc: ibmvsm: Fix potential NULL pointer dereference
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Wed, 16 Jan 2019 16:46:16 +0000 (10:46 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Jan 2019 13:14:14 +0000 (14:14 +0100)
commita6514c5875bf1b0f4e2064e94e1affe698f5e52e
tree6e5615c058f1384c5772c7d5ec2ef194f0764d73
parent852f4e36c10e86cc51fc328a7264484c52634c1c
misc: ibmvsm: Fix potential NULL pointer dereference

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

Fix this by adding a NULL check on *session*

Also, update the function header with information about the
expected return on failure and remove unnecessary variable rc.

This issue was detected with the help of Coccinelle.

Fixes: 6debea7135d9 ("misc: IBM Virtual Management Channel Driver (VMC)")
Cc: stable@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/ibmvmc.c