]> www.infradead.org Git - users/dwmw2/linux.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>
Thu, 31 Jan 2019 07:15:38 +0000 (08:15 +0100)
commit1fa50a998f17ee4fb1650b013d8b529e010ef8b3
tree89664e8473478d64c027a19ccc62a9c172733430
parentae108579558ed637b8634a31b4e5af2e64e9d32d
misc: ibmvsm: Fix potential NULL pointer dereference

commit e25df7812c91f62581301f9a7ac102acf92e4937 upstream.

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: 0eca353e7ae7 ("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