Skip to content

Commit ca28bbc

Browse files
authored
Merge pull request #5 from charliechiou/main
Improve warning message for fast buffer overflow
2 parents 3b85299 + 5d04eda commit ca28bbc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

simrupt.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,9 @@ static void process_data(void)
214214
WARN_ON_ONCE(!irqs_disabled());
215215

216216
pr_info("simrupt: [CPU#%d] produce data\n", smp_processor_id());
217-
fast_buf_put(update_simrupt_data());
217+
int ret = fast_buf_put(update_simrupt_data());
218+
if (unlikely(ret < 0) && printk_ratelimit())
219+
pr_warn("simrupt: fast_buf is full, dropping data\n");
218220

219221
pr_info("simrupt: [CPU#%d] scheduling tasklet\n", smp_processor_id());
220222
tasklet_schedule(&simrupt_tasklet);

0 commit comments

Comments
 (0)