Commit 52785b6a authored by Wei Yongjun's avatar Wei Yongjun Committed by Paul E. McKenney

kcsan: Use GFP_ATOMIC under spin lock

A spin lock is held in insert_report_filterlist(), so the krealloc()
should use GFP_ATOMIC.  This commit therefore makes this change.
Reviewed-by: default avatarMarco Elver <elver@google.com>
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent eba9c444
...@@ -230,7 +230,7 @@ static ssize_t insert_report_filterlist(const char *func) ...@@ -230,7 +230,7 @@ static ssize_t insert_report_filterlist(const char *func)
/* initial allocation */ /* initial allocation */
report_filterlist.addrs = report_filterlist.addrs =
kmalloc_array(report_filterlist.size, kmalloc_array(report_filterlist.size,
sizeof(unsigned long), GFP_KERNEL); sizeof(unsigned long), GFP_ATOMIC);
if (report_filterlist.addrs == NULL) { if (report_filterlist.addrs == NULL) {
ret = -ENOMEM; ret = -ENOMEM;
goto out; goto out;
...@@ -240,7 +240,7 @@ static ssize_t insert_report_filterlist(const char *func) ...@@ -240,7 +240,7 @@ static ssize_t insert_report_filterlist(const char *func)
size_t new_size = report_filterlist.size * 2; size_t new_size = report_filterlist.size * 2;
unsigned long *new_addrs = unsigned long *new_addrs =
krealloc(report_filterlist.addrs, krealloc(report_filterlist.addrs,
new_size * sizeof(unsigned long), GFP_KERNEL); new_size * sizeof(unsigned long), GFP_ATOMIC);
if (new_addrs == NULL) { if (new_addrs == NULL) {
/* leave filterlist itself untouched */ /* leave filterlist itself untouched */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment