linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Silvan Jegen <s.jegen@gmail.com>
To: Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	linux-media@vger.kernel.org
Cc: Silvan Jegen <s.jegen@gmail.com>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH 2/2] [media] mantis: Use correct goto labels for cleanup on error
Date: Sun, 15 Feb 2015 13:11:05 +0100	[thread overview]
Message-ID: <1424002265-16865-3-git-send-email-s.jegen@gmail.com> (raw)
In-Reply-To: <1424002265-16865-1-git-send-email-s.jegen@gmail.com>

After calling mantis_pci_init we have to jump to fail2 in order to call
the corresponding mantis_pci_exit. Similarly, after calling mantis_get_mac
we have already called mantis_pci_init and mantis_i2c_init so we need
to jump to fail3 if we want to call the corresponding exit functions.

Signed-off-by: Silvan Jegen <s.jegen@gmail.com>
---
 drivers/media/pci/mantis/mantis_cards.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/pci/mantis/mantis_cards.c b/drivers/media/pci/mantis/mantis_cards.c
index e566061..71497d8 100644
--- a/drivers/media/pci/mantis/mantis_cards.c
+++ b/drivers/media/pci/mantis/mantis_cards.c
@@ -183,7 +183,7 @@ static int mantis_pci_probe(struct pci_dev *pdev,
 	err = mantis_pci_init(mantis);
 	if (err) {
 		dprintk(MANTIS_ERROR, 1, "ERROR: Mantis PCI initialization failed <%d>", err);
-		goto fail1;
+		goto fail2;
 	}
 
 	err = mantis_stream_control(mantis, STREAM_TO_HIF);
@@ -201,7 +201,7 @@ static int mantis_pci_probe(struct pci_dev *pdev,
 	err = mantis_get_mac(mantis);
 	if (err < 0) {
 		dprintk(MANTIS_ERROR, 1, "ERROR: Mantis MAC address read failed <%d>", err);
-		goto fail2;
+		goto fail3;
 	}
 
 	err = mantis_dma_init(mantis);
-- 
2.2.2


      parent reply	other threads:[~2015-02-15 12:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-15 12:11 [PATCH 0/2] [media] mantis: Fix goto labels Silvan Jegen
2015-02-15 12:11 ` [PATCH 1/2] [media] mantis: Move jump label to activate dead code Silvan Jegen
2015-02-16  9:04   ` Dan Carpenter
2015-02-17  9:48     ` Silvan Jegen
2015-03-22 17:16     ` [PATCH v2] [media] mantis: fix error handling Silvan Jegen
2015-03-22 22:48       ` Dan Carpenter
2015-03-23 16:25         ` [PATCH V3] " Silvan Jegen
2015-03-23 16:32           ` Dan Carpenter
2015-02-15 12:11 ` Silvan Jegen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1424002265-16865-3-git-send-email-s.jegen@gmail.com \
    --to=s.jegen@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@osg.samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).