cxgb4: Fix error handling path in 'init_one()'

"Linux Kernel Mailing List" <[email protected]>
Newsgroups gmane.linux.kernel.commits.head
Message-ID <[email protected]>
Web:        https://git.kernel.org/torvalds/c/e729452ec33304260d4741e9ce67784a457ee1e6
Commit:     e729452ec33304260d4741e9ce67784a457ee1e6
Parent:     4d80ecdb80a7aab7652a206a1d948ef0d1df89b1
Refname:    refs/heads/master
Author:     Christophe JAILLET <[email protected]>
AuthorDate: Tue Feb 6 21:17:17 2018 +0100
Committer:  David S. Miller <[email protected]>
CommitDate: Wed Feb 7 21:46:06 2018 -0500

    cxgb4: Fix error handling path in 'init_one()'
    
    Commit baf5086840ab1 ("cxgb4: restructure VF mgmt code") has reordered
    some code but an error handling label has not been updated accordingly.
    So fix it and free 'adapter' if 't4_wait_dev_ready()' fails.
    
    Fixes: baf5086840ab1 ("cxgb4: restructure VF mgmt code")
    Signed-off-by: Christophe JAILLET <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 1ca2a39ed0f8..56bc626ef006 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -5166,7 +5166,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	adapter->regs = regs;
 	err = t4_wait_dev_ready(regs);
 	if (err < 0)
-		goto out_unmap_bar0;
+		goto out_free_adapter;
 
 	/* We control everything through one PF */
 	whoami = readl(regs + PL_WHOAMI_A);
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.