From: Thomas Graf <tgraf@suug.ch>
To: "Catalin(ux aka Dino) BOIE" <util@deuroconsult.ro>
Cc: netdev@oss.sgi.com, davem@davemloft.net
Subject: Re: [PATCH] rtnl_unlock/lock in sch_api.c
Date: Mon, 28 Mar 2005 16:47:01 +0200 [thread overview]
Message-ID: <20050328144701.GA3086@postel.suug.ch> (raw)
In-Reply-To: <Pine.LNX.4.62.0503281720430.20453@webhosting.rdsbv.ro>
Looks good, except...
> --- linux/net/sched/sch_api.c.orig 2005-03-28 16:32:57.000000000 +0300
> +++ linux/net/sched/sch_api.c 2005-03-28 16:38:17.000000000 +0300
> @@ -404,18 +404,28 @@ qdisc_create(struct net_device *dev, u32
> struct Qdisc_ops *ops;
> int size;
>
> + err = -EINVAL;
> ops = qdisc_lookup_ops(kind);
> #ifdef CONFIG_KMOD
> - if (ops==NULL && tca[TCA_KIND-1] != NULL) {
> + if (ops == NULL && kind != NULL) {
> char name[IFNAMSIZ];
> if (rtattr_strlcpy(name, kind, IFNAMSIZ) < IFNAMSIZ) {
> + /* Must drop rtnl sem because request_module
> + * can try to aquire rtnl sem (see teql for
> + * example)
> + */
> + rtnl_unlock();
> request_module("sch_%s", name);
> + rtnl_lock();
> ops = qdisc_lookup_ops(kind);
> + if (ops != NULL) {
> + module_put(ops->owner);
> + err = -EAGAIN;
You're missing a goto err_out here, the ops == NULL won't catch it.
> + }
> }
> }
> #endif
>
> - err = -EINVAL;
> if (ops == NULL)
> goto err_out;
With the above goto inserted there is no need to move the err = -EINVAL.
next prev parent reply other threads:[~2005-03-28 14:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-28 14:25 [PATCH] rtnl_unlock/lock in sch_api.c Catalin(ux aka Dino) BOIE
2005-03-28 14:47 ` Thomas Graf [this message]
2005-03-28 22:27 ` Catalin(ux aka Dino) BOIE
2005-03-28 14:50 ` Patrick McHardy
2005-03-28 22:16 ` Catalin(ux aka Dino) BOIE
2005-03-28 22:20 ` Patrick McHardy
2005-03-28 22:21 ` Catalin(ux aka Dino) BOIE
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=20050328144701.GA3086@postel.suug.ch \
--to=tgraf@suug.ch \
--cc=davem@davemloft.net \
--cc=netdev@oss.sgi.com \
--cc=util@deuroconsult.ro \
/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).