diff mbox series

[09/11] kasan: add missing annotation for start_report()

Message ID 1eca01a2537e0500f4f31c335edfecf0a10bd294.1581282103.git.jbi.octave@gmail.com (mailing list archive)
State New, archived
Headers show
Series Lock warning cleanup | expand

Commit Message

Jules Irenge Feb. 9, 2020, 10:48 p.m. UTC
Sparse reports a warning at start_report()

warning: context imbalance in start_report() - wrong count at exit

The root cause is a missing annotation at start_report()

Add the missing annotation __acquires(&report_lock)

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 mm/kasan/report.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dmitry Vyukov Feb. 10, 2020, 7:27 a.m. UTC | #1
On Sun, Feb 9, 2020 at 11:48 PM Jules Irenge <jbi.octave@gmail.com> wrote:
>
> Sparse reports a warning at start_report()
>
> warning: context imbalance in start_report() - wrong count at exit
>
> The root cause is a missing annotation at start_report()
>
> Add the missing annotation __acquires(&report_lock)
>
> Signed-off-by: Jules Irenge <jbi.octave@gmail.com>

Acked-by: Dmitry Vyukov <dvyukov@google.com>

> ---
>  mm/kasan/report.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/kasan/report.c b/mm/kasan/report.c
> index 5ef9f24f566b..5451624c4e09 100644
> --- a/mm/kasan/report.c
> +++ b/mm/kasan/report.c
> @@ -77,7 +77,7 @@ static void print_error_description(struct kasan_access_info *info)
>
>  static DEFINE_SPINLOCK(report_lock);
>
> -static void start_report(unsigned long *flags)
> +static void start_report(unsigned long *flags) __acquires(&report_lock)
>  {
>         /*
>          * Make sure we don't end up in loop.
> --
> 2.24.1
>
diff mbox series

Patch

diff --git a/mm/kasan/report.c b/mm/kasan/report.c
index 5ef9f24f566b..5451624c4e09 100644
--- a/mm/kasan/report.c
+++ b/mm/kasan/report.c
@@ -77,7 +77,7 @@  static void print_error_description(struct kasan_access_info *info)
 
 static DEFINE_SPINLOCK(report_lock);
 
-static void start_report(unsigned long *flags)
+static void start_report(unsigned long *flags) __acquires(&report_lock)
 {
 	/*
 	 * Make sure we don't end up in loop.