| .. | .. |
|---|
| 149 | 149 | const bool is_assert = (r->access[0].type | r->access[1].type) & KCSAN_ACCESS_ASSERT; |
|---|
| 150 | 150 | bool ret = false; |
|---|
| 151 | 151 | unsigned long flags; |
|---|
| 152 | | - typeof(observed.lines) expect; |
|---|
| 152 | + typeof(*observed.lines) *expect; |
|---|
| 153 | 153 | const char *end; |
|---|
| 154 | 154 | char *cur; |
|---|
| 155 | 155 | int i; |
|---|
| 156 | 156 | |
|---|
| 157 | 157 | /* Doubled-checked locking. */ |
|---|
| 158 | 158 | if (!report_available()) |
|---|
| 159 | + return false; |
|---|
| 160 | + |
|---|
| 161 | + expect = kmalloc(sizeof(observed.lines), GFP_KERNEL); |
|---|
| 162 | + if (WARN_ON(!expect)) |
|---|
| 159 | 163 | return false; |
|---|
| 160 | 164 | |
|---|
| 161 | 165 | /* Generate expected report contents. */ |
|---|
| .. | .. |
|---|
| 241 | 245 | strstr(observed.lines[2], expect[1]))); |
|---|
| 242 | 246 | out: |
|---|
| 243 | 247 | spin_unlock_irqrestore(&observed.lock, flags); |
|---|
| 248 | + kfree(expect); |
|---|
| 244 | 249 | return ret; |
|---|
| 245 | 250 | } |
|---|
| 246 | 251 | |
|---|