From: Dan Carpenter <dan.carpenter@linaro.org>
To: apopple@nvidia.com
Cc: linux-mm@kvack.org
Subject: [bug report] mmu_notifiers: rename invalidate_range notifier
Date: Fri, 21 Jul 2023 09:23:12 +0300 [thread overview]
Message-ID: <38ed0627-1283-4da2-827a-e90484d7bd7d@moroto.mountain> (raw)
Hello Alistair Popple,
The patch 828fe4085cae: "mmu_notifiers: rename invalidate_range
notifier" from Jul 19, 2023 (linux-next), leads to the following
Smatch static checker warning:
mm/mmu_notifier.c:1020 mmu_interval_notifier_insert_locked()
error: NULL dereference inside function __mmu_notifier_register()
mm/mmu_notifier.c:671 __mmu_notifier_register()
warn: variable dereferenced before check 'subscription' (see line 624)
mm/mmu_notifier.c
1010 unsigned long start, unsigned long length,
1011 const struct mmu_interval_notifier_ops *ops)
1012 {
1013 struct mmu_notifier_subscriptions *subscriptions =
1014 mm->notifier_subscriptions;
1015 int ret;
1016
1017 mmap_assert_write_locked(mm);
1018
1019 if (!subscriptions || !subscriptions->has_itree) {
--> 1020 ret = __mmu_notifier_register(NULL, mm);
subscription is NULL here
1021 if (ret)
1022 return ret;
1023 subscriptions = mm->notifier_subscriptions;
1024 }
1025 return __mmu_interval_notifier_insert(interval_sub, mm, subscriptions,
1026 start, length, ops);
1027 }
regards,
dan carpenter
reply other threads:[~2023-07-21 6:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=38ed0627-1283-4da2-827a-e90484d7bd7d@moroto.mountain \
--to=dan.carpenter@linaro.org \
--cc=apopple@nvidia.com \
--cc=linux-mm@kvack.org \
/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