[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200403183550.GS2910@minyard.net>
Date: Fri, 3 Apr 2020 13:35:50 -0500
From: Corey Minyard <minyard@....org>
To: Jules Irenge <jbi.octave@...il.com>
Cc: linux-kernel@...r.kernel.org, boqun.feng@...il.com,
Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"moderated list:IPMI SUBSYSTEM"
<openipmi-developer@...ts.sourceforge.net>
Subject: Re: [PATCH 5/5] ipmi: Add missing annotation for
ipmi_ssif_lock_cond() and ipmi_ssif_unlock_cond()
On Fri, Apr 03, 2020 at 05:05:05PM +0100, Jules Irenge wrote:
> Sparse reports a warning at ipmi_ssif_unlock_cond()
> and ipmi_ssif_lock_cond()
>
> warning: context imbalance in ipmi_ssif_lock_cond()
> - wrong count at exit
> warning: context imbalance in ipmi_ssif_unlock_cond()
> - unexpected unlock
>
> The root cause is the missing annotation at ipmi_ssif_unlock_cond()
> and ipmi_ssif_lock_cond()
>
> Add the missing __acquires(&ata_scsi_rbuf_lock)
> Add the missing __releases(&ata_scsi_rbuf_lock)
Yeah, this is good, I've included it in my tree.
-corey
>
> Signed-off-by: Jules Irenge <jbi.octave@...il.com>
> ---
> drivers/char/ipmi/ipmi_ssif.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c
> index 22c6a2e61236..030e7c09e44f 100644
> --- a/drivers/char/ipmi/ipmi_ssif.c
> +++ b/drivers/char/ipmi/ipmi_ssif.c
> @@ -313,6 +313,7 @@ static int start_send(struct ssif_info *ssif_info,
>
> static unsigned long *ipmi_ssif_lock_cond(struct ssif_info *ssif_info,
> unsigned long *flags)
> + __acquires(&ssif_info->lock)
> {
> spin_lock_irqsave(&ssif_info->lock, *flags);
> return flags;
> @@ -320,6 +321,7 @@ static unsigned long *ipmi_ssif_lock_cond(struct ssif_info *ssif_info,
>
> static void ipmi_ssif_unlock_cond(struct ssif_info *ssif_info,
> unsigned long *flags)
> + __releases(&ssif_info->lock)
> {
> spin_unlock_irqrestore(&ssif_info->lock, *flags);
> }
> --
> 2.24.1
>
Powered by blists - more mailing lists