Skip to content

Commit 52785b6

Browse files
Wei Yongjunpaulmckrcu
authored andcommitted
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: Marco Elver <[email protected]> Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent eba9c44 commit 52785b6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/kcsan/debugfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ static ssize_t insert_report_filterlist(const char *func)
230230
/* initial allocation */
231231
report_filterlist.addrs =
232232
kmalloc_array(report_filterlist.size,
233-
sizeof(unsigned long), GFP_KERNEL);
233+
sizeof(unsigned long), GFP_ATOMIC);
234234
if (report_filterlist.addrs == NULL) {
235235
ret = -ENOMEM;
236236
goto out;
@@ -240,7 +240,7 @@ static ssize_t insert_report_filterlist(const char *func)
240240
size_t new_size = report_filterlist.size * 2;
241241
unsigned long *new_addrs =
242242
krealloc(report_filterlist.addrs,
243-
new_size * sizeof(unsigned long), GFP_KERNEL);
243+
new_size * sizeof(unsigned long), GFP_ATOMIC);
244244

245245
if (new_addrs == NULL) {
246246
/* leave filterlist itself untouched */

0 commit comments

Comments
 (0)