From: David Miller <davem@davemloft.net>
To: segooon@gmail.com
Cc: kernel-janitors@vger.kernel.org, jpirko@redhat.com,
joe@perches.com, shemminger@vyatta.com, eric.dumazet@gmail.com,
netdev@vger.kernel.org
Subject: Re: [PATCH] depca: fix leaks
Date: Sun, 11 Jul 2010 18:13:00 -0700 (PDT) [thread overview]
Message-ID: <20100711.181300.58435799.davem@davemloft.net> (raw)
In-Reply-To: <1278678986-7725-1-git-send-email-segooon@gmail.com>
From: Kulikov Vasiliy <segooon@gmail.com>
Date: Fri, 9 Jul 2010 16:36:25 +0400
> Since some of xxx_register_driver() can return error we must continue
> with already registered drivers. If any of xxx_register_driver()
> succeeded or depca_platform_probe() found any device then
> depca_module_init() returns ok. In depca_module_exit() we must
> unregister only registered drivers.
>
> Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Driver registry should succeed except in cases that would indicate a
serious driver bug, such as trying to register the same driver twice.
Therefore if any registry fails, we should fail the entire probe.
This is the scheme used in just about any driver I've had any
involvement in, see for example drivers/net/niu.c:
--------------------
#ifdef CONFIG_SPARC64
err = of_register_driver(&niu_of_driver, &of_bus_type);
#endif
if (!err) {
err = pci_register_driver(&niu_pci_driver);
#ifdef CONFIG_SPARC64
if (err)
of_unregister_driver(&niu_of_driver);
#endif
}
return err;
--------------------
Please do something similar here in depca, thanks.
next prev parent reply other threads:[~2010-07-12 1:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-09 12:36 [PATCH] depca: fix leaks Kulikov Vasiliy
2010-07-12 1:13 ` David Miller [this message]
2010-07-12 14:52 ` [PATCH v2] depca: fix leaks in depca_module_init() Kulikov Vasiliy
2010-07-13 3:32 ` David Miller
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=20100711.181300.58435799.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=joe@perches.com \
--cc=jpirko@redhat.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=segooon@gmail.com \
--cc=shemminger@vyatta.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).