mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 21:22:09 -04:00
net: qlge: fix a potential NULL pointer dereference
In case alloc_ordered_workqueue fails, the fix returns -ENOMEM to avoid NULL pointer dereference. Signed-off-by: Kangjie Lu <kjlu@umn.edu> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ab0891f5d8
commit
4280b73092
1 changed files with 5 additions and 0 deletions
|
|
@ -4681,6 +4681,11 @@ static int ql_init_device(struct pci_dev *pdev, struct net_device *ndev,
|
|||
*/
|
||||
qdev->workqueue = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM,
|
||||
ndev->name);
|
||||
if (!qdev->workqueue) {
|
||||
err = -ENOMEM;
|
||||
goto err_out2;
|
||||
}
|
||||
|
||||
INIT_DELAYED_WORK(&qdev->asic_reset_work, ql_asic_reset_work);
|
||||
INIT_DELAYED_WORK(&qdev->mpi_reset_work, ql_mpi_reset_work);
|
||||
INIT_DELAYED_WORK(&qdev->mpi_work, ql_mpi_work);
|
||||
|
|
|
|||
Loading…
Reference in a new issue