net: aquantia: Fix error handling in aq_pci_probe()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 22 Feb 2018 09:11:55 +0000 (12:11 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 22 Feb 2018 20:33:16 +0000 (15:33 -0500)
commit370c10522e96bf1b2e7fd9e906dbe8fb5be895d2
tree64513ef921a3a0a9ae871b4e23ef88ad5c07af19
parented04c46d4e70007e102d88dd2ee648008f7f634d
net: aquantia: Fix error handling in aq_pci_probe()

We should check "self->aq_hw" for allocation failure, and also we should
free it on the error paths.

Fixes: 23ee07ad3c2f ("net: aquantia: Cleanup pci functions module")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c