Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751488AbcLDNUR (ORCPT ); Sun, 4 Dec 2016 08:20:17 -0500 Received: from mail-wm0-f48.google.com ([74.125.82.48]:38340 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751169AbcLDNUN (ORCPT ); Sun, 4 Dec 2016 08:20:13 -0500 From: Netanel Belgazal To: linux-kernel@vger.kernel.org, davem@davemloft.net, netdev@vger.kernel.org Cc: Netanel Belgazal , dwmw@amazon.com, zorik@annapurnalabs.com, alex@annapurnalabs.com, saeed@annapurnalabs.com, msw@amazon.com, aliguori@amazon.com, nafea@annapurnalabs.com Subject: [PATCH V2 net 02/20] net/ena: fix error handling when probe fails Date: Sun, 4 Dec 2016 15:19:20 +0200 Message-Id: <1480857578-5065-3-git-send-email-netanel@annapurnalabs.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1480857578-5065-1-git-send-email-netanel@annapurnalabs.com> References: <1480857578-5065-1-git-send-email-netanel@annapurnalabs.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 826 Lines: 24 When driver fails in probe, it will release all resources, including adapter. In case of probe failure, ena_remove should not try to free the adapter resources. Signed-off-by: Netanel Belgazal --- drivers/net/ethernet/amazon/ena/ena_netdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c index 33a760e..397c9bc 100644 --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c @@ -3054,6 +3054,7 @@ static int ena_probe(struct pci_dev *pdev, const struct pci_device_id *ent) err_free_region: ena_release_bars(ena_dev, pdev); err_free_ena_dev: + pci_set_drvdata(pdev, NULL); vfree(ena_dev); err_disable_device: pci_disable_device(pdev); -- 2.7.4