From: Jules Irenge <jbi.octave@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Dan Carpenter <dan.carpenter@oracle.com>,
Heiner Kallweit <hkallweit1@gmail.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
netdev@vger.kernel.org (open list:NETWORKING [GENERAL])
Subject: [PATCH 4/6] net: atm: Add missing annotation for lec_seq_stop()
Date: Wed, 29 Apr 2020 11:05:26 +0100 [thread overview]
Message-ID: <20200429100529.19645-5-jbi.octave@gmail.com> (raw)
In-Reply-To: <20200429100529.19645-1-jbi.octave@gmail.com>
Sparse reports a warning at lec_seq_stop()
warning: context imbalance in lec_seq_stop() - unexpected unlock
The root cause is the missing annotation at lec_seq_stop()
The __release() annotation inside lec_seq_stop()
tells only Sparse to shutdown the warning
Add the missing __releases(&state->locked->lec_arp_lock)
Add __release(&state->locked->lec_arp_lock) annotation
Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
net/atm/lec.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/net/atm/lec.c b/net/atm/lec.c
index 25fa3a7b72bd..22415bc11878 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -940,6 +940,7 @@ static void *lec_seq_start(struct seq_file *seq, loff_t *pos)
}
static void lec_seq_stop(struct seq_file *seq, void *v)
+ __releases(&state->locked->lec_arp_lock)
{
struct lec_state *state = seq->private;
@@ -947,7 +948,9 @@ static void lec_seq_stop(struct seq_file *seq, void *v)
spin_unlock_irqrestore(&state->locked->lec_arp_lock,
state->flags);
dev_put(state->dev);
- }
+ } else
+ /* annotation for sparse */
+ __release(&state->locked->lec_arp_lock);
}
static void *lec_seq_next(struct seq_file *seq, void *v, loff_t *pos)
--
2.25.3
next prev parent reply other threads:[~2020-04-29 10:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <0/6>
[not found] ` <20200429100529.19645-1-jbi.octave@gmail.com>
2020-04-29 10:05 ` [PATCH 2/6] udp: Add missing annotations for busylock_acquire() and busylock_release() Jules Irenge
2020-04-29 10:05 ` [PATCH 3/6] udp: Add annotations for udp_rmem_release() Jules Irenge
2020-04-29 10:05 ` Jules Irenge [this message]
2020-04-29 10:05 ` [PATCH 6/6] net: atm: Add annotation for lec_priv_walk() Jules Irenge
2020-04-29 10:22 ` Andy Shevchenko
2020-04-29 14:58 ` [PATCH v2] net: atm: Add annotation for lec_priv_walk() and lec_seq_stop() Jules Irenge
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=20200429100529.19645-5-jbi.octave@gmail.com \
--to=jbi.octave@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=tglx@linutronix.de \
/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).