From: Jiri Pirko <jiri@resnulli.us>
To: Taehee Yoo <ap420073@gmail.com>
Cc: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH net v2] team: fix hang in team_mode_get()
Date: Mon, 20 Apr 2020 16:35:02 +0200 [thread overview]
Message-ID: <20200420143502.GO6581@nanopsycho.orion> (raw)
In-Reply-To: <20200420131145.20146-1-ap420073@gmail.com>
Mon, Apr 20, 2020 at 03:11:45PM CEST, ap420073@gmail.com wrote:
[...]
>diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
>index 4004f98e50d9..4f1ccbafb961 100644
>--- a/drivers/net/team/team.c
>+++ b/drivers/net/team/team.c
>@@ -465,8 +465,11 @@ EXPORT_SYMBOL(team_mode_unregister);
>
> static const struct team_mode *team_mode_get(const char *kind)
> {
>- struct team_mode_item *mitem;
> const struct team_mode *mode = NULL;
>+ struct team_mode_item *mitem;
Remove this unrelated move from the patch.
>+
>+ if (!try_module_get(THIS_MODULE))
>+ return NULL;
>
> spin_lock(&mode_list_lock);
> mitem = __find_mode(kind);
>@@ -483,6 +486,7 @@ static const struct team_mode *team_mode_get(const char *kind)
> }
>
> spin_unlock(&mode_list_lock);
>+ module_put(THIS_MODULE);
> return mode;
> }
>
>--
>2.17.1
>
next prev parent reply other threads:[~2020-04-20 14:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-20 13:11 [PATCH net v2] team: fix hang in team_mode_get() Taehee Yoo
2020-04-20 14:35 ` Jiri Pirko [this message]
2020-04-20 14:48 ` Taehee Yoo
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=20200420143502.GO6581@nanopsycho.orion \
--to=jiri@resnulli.us \
--cc=ap420073@gmail.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=netdev@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 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).