From: Akinobu Mita <akinobu.mita@gmail.com>
To: linux-scsi@vger.kernel.org
Cc: Akinobu Mita <akinobu.mita@gmail.com>,
Anil Ravindranath <anil_ravindranath@pmc-sierra.com>,
"James E.J. Bottomley" <JBottomley@parallels.com>
Subject: [PATCH 2/5] pmcraid: fix pmcraid_netlink_init() error path in module_init
Date: Sat, 16 Feb 2013 23:27:56 +0900 [thread overview]
Message-ID: <1361024879-12934-2-git-send-email-akinobu.mita@gmail.com> (raw)
In-Reply-To: <1361024879-12934-1-git-send-email-akinobu.mita@gmail.com>
pmcraid_netlink_init() error path in module_init doesn't destroy
a struct class that was created just before.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Anil Ravindranath <anil_ravindranath@pmc-sierra.com>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: linux-scsi@vger.kernel.org
---
drivers/scsi/pmcraid.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index 073ff48..db77bf9 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -6114,18 +6114,20 @@ static int __init pmcraid_init(void)
error = pmcraid_netlink_init();
if (error)
- goto out_unreg_chrdev;
+ goto out_class_destroy;
error = pci_register_driver(&pmcraid_driver);
- if (error == 0)
- goto out_init;
+ if (error)
+ goto out_netlink_release;
- pmcraid_err("failed to register pmcraid driver, error = %x\n",
- error);
- class_destroy(pmcraid_class);
- pmcraid_netlink_release();
+ return 0;
+out_netlink_release:
+ pmcraid_err("failed to register pmcraid driver, error = %x\n", error);
+ pmcraid_netlink_release();
+out_class_destroy:
+ class_destroy(pmcraid_class);
out_unreg_chrdev:
unregister_chrdev_region(MKDEV(pmcraid_major, 0), PMCRAID_MAX_ADAPTERS);
--
1.8.1
next prev parent reply other threads:[~2013-02-16 14:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-16 14:27 [PATCH 1/5] pmcraid: fix a typo in error message Akinobu Mita
2013-02-16 14:27 ` Akinobu Mita [this message]
2013-02-16 14:27 ` [PATCH 3/5] pmcraid: make pmcraid_minor static Akinobu Mita
2013-02-16 14:27 ` [PATCH 4/5] pmcraid: check for exceeding the max adapters limit Akinobu Mita
2013-02-16 14:27 ` [PATCH 5/5] pmcraid: check error from device_create() Akinobu Mita
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=1361024879-12934-2-git-send-email-akinobu.mita@gmail.com \
--to=akinobu.mita@gmail.com \
--cc=JBottomley@parallels.com \
--cc=anil_ravindranath@pmc-sierra.com \
--cc=linux-scsi@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.