mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: linux-scsi@vger.kernel.org, MPT-FusionLinux.pdl@broadcom.com,
	"Ewan D. Milne" <emilne@redhat.com>,
	Johannes Thumshirn <jthumshirn@suse.de>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Sathya Prakash <sathya.prakash@broadcom.com>,
	Sreekanth Reddy <sreekanth.reddy@broadcom.com>,
	Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>,
	Ranjan Kumar <ranjan.kumar@broadcom.com>,
	Tomas Henzl <thenzl@redhat.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org, Insu Yun <wuninsu@gmail.com>
Subject: [PATCH] scsi: message: fusion: Use more common error handling code in mpt_attach()
Date: Wed, 17 Jun 2026 20:34:09 +0200	[thread overview]
Message-ID: <645f850d-bd48-4c72-97e4-5771e247de8f@web.de> (raw)

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 17 Jun 2026 20:22:26 +0200

Use an existing label once more so that a bit of exception handling can be
better reused at the end of this function implementation.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/message/fusion/mptbase.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 3a431ffd3e2e..c2c5a25cf5ae 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -2014,9 +2014,7 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
 
 		destroy_workqueue(ioc->reset_work_q);
 		ioc->reset_work_q = NULL;
-
-		kfree(ioc);
-		return r;
+		goto out_free_ioc;
 	}
 
 	/* call per device driver probe entry point */
-- 
2.54.0


                 reply	other threads:[~2026-06-17 18:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=645f850d-bd48-4c72-97e4-5771e247de8f@web.de \
    --to=markus.elfring@web.de \
    --cc=MPT-FusionLinux.pdl@broadcom.com \
    --cc=emilne@redhat.com \
    --cc=jthumshirn@suse.de \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=ranjan.kumar@broadcom.com \
    --cc=sathya.prakash@broadcom.com \
    --cc=sreekanth.reddy@broadcom.com \
    --cc=suganath-prabu.subramani@broadcom.com \
    --cc=thenzl@redhat.com \
    --cc=wuninsu@gmail.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

all inboxes | Powered by JetHome®