Skip to content

Commit

Permalink
ipc/msg: add missing annotation for freeque()
Browse files Browse the repository at this point in the history
Sparse reports a warning at freeque()

warning: context imbalance in freeque() - unexpected unlock

The root cause is the missing annotation at freeque()

Add the missing __releases(RCU) annotation
Add the missing __releases(&msq->q_perm) annotation

Signed-off-by: Jules Irenge <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Cc: Boqun Feng <[email protected]>
Cc: Lu Shuaibing <[email protected]>
Cc: Nathan Chancellor <[email protected]>
Cc: Manfred Spraul <[email protected]>
Cc: Davidlohr Bueso <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
irenge authored and torvalds committed Jun 8, 2020
1 parent 92fb1db commit 4b78e20
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ipc/msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ static void expunge_all(struct msg_queue *msq, int res,
* before freeque() is called. msg_ids.rwsem remains locked on exit.
*/
static void freeque(struct ipc_namespace *ns, struct kern_ipc_perm *ipcp)
__releases(RCU)
__releases(&msq->q_perm)
{
struct msg_msg *msg, *t;
struct msg_queue *msq = container_of(ipcp, struct msg_queue, q_perm);
Expand Down

0 comments on commit 4b78e20

Please sign in to comment.