Thread (1 message) 1 message, 1 author, 2020-02-14
STALE2377d

[PATCH 20/30] pcnet32: Add missing annotation for pcnet32_suspend()

From: Jules Irenge <hidden>
Date: 2020-02-14 20:50:12
Also in: lkml
Subsystem: networking drivers, pcnet32 network driver, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Don Fry, Linus Torvalds

Sparse reports a warning at pcnet32_suspend()

warning: context imbalance in pcnet32_suspend() - unexpected unlock

The root cause is the missing annotation at pcnet32_suspend()
Add the missing __must_hold(&lp->lock) annotattion

Signed-off-by: Jules Irenge <redacted>
---
 drivers/net/ethernet/amd/pcnet32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/amd/pcnet32.c b/drivers/net/ethernet/amd/pcnet32.c
index dc7d88227e76..ac6c19441932 100644
--- a/drivers/net/ethernet/amd/pcnet32.c
+++ b/drivers/net/ethernet/amd/pcnet32.c
@@ -684,7 +684,7 @@ static void pcnet32_poll_controller(struct net_device *dev)
  * lp->lock must be held.
  */
 static int pcnet32_suspend(struct net_device *dev, unsigned long *flags,
-			   int can_sleep)
+			   int can_sleep) __must_hold(&lp->lock)
 {
 	int csr5;
 	struct pcnet32_private *lp = netdev_priv(dev);
-- 
2.24.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help