e100: Add a check after pci_pool_create to avoid null pointer dereference
authorJia-Ju Bai <baijiaju1990@163.com>
Mon, 3 Aug 2015 02:17:08 +0000 (10:17 +0800)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 18 Aug 2015 21:06:05 +0000 (14:06 -0700)
commit9ad607b4a9cb365fbd8387b1250ec448e497223e
tree5b1eb222a58b7f4c10c52379c10a6698adaab160
parentc23d92b80e0b44d4c17085f0413e7574a7583615
e100: Add a check after pci_pool_create to avoid null pointer dereference

The driver lacks the check of nic->cbs_pool after pci_pool_create
in e100_probe. When this function is failed, a null pointer dereference
occurs when pci_pool_alloc uses nic->cbs_pool in e100_alloc_cbs.
This patch adds a check and related error handling code to fix it.

Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/e100.c