OSDN Git Service

libertas: check return value of alloc_workqueue
authorPan Bian <bianpan2016@163.com>
Sun, 23 Apr 2017 13:19:38 +0000 (21:19 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 24 Mar 2018 10:00:15 +0000 (11:00 +0100)
commit0397b294e87940c35af30e0a5bd6cfc110d132cb
treee785697cad9be1c284e9bc9af8b6fcb1482a8005
parent9d79cd54ba0e3b712d734eb24210432680900154
libertas: check return value of alloc_workqueue

[ Upstream commit dc3f89c38a8406554ffeffa370aad086a9c5e9de ]

Function alloc_workqueue() will return a NULL pointer if there is no
enough memory, and its return value should be validated before using.
However, in function if_spi_probe(), its return value is not checked.
This may result in a NULL dereference bug. This patch fixes the bug.

Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/marvell/libertas/if_spi.c