Messages in this thread Patch in this message | | | From | John Ogness <> | Subject | Re: [PATCH printk v1 06/18] printk: nobkl: Add acquire/release logic | Date | Mon, 06 Mar 2023 10:45:46 +0106 |
| |
On 2023-03-06, Dan Carpenter <error27@gmail.com> wrote: > smatch warnings: > kernel/printk/printk_nobkl.c:391 cons_try_acquire_spin() warn: signedness bug returning '(-16)'
Great catch. That function used to return bool, but recently changed to int. The consequence of the bug is that a waiter could prematurely abort the spin.
diff --git a/kernel/printk/printk_nobkl.c b/kernel/printk/printk_nobkl.c index 78136347a328..bcd75e5bd9c8 100644 --- a/kernel/printk/printk_nobkl.c +++ b/kernel/printk/printk_nobkl.c @@ -305,7 +305,7 @@ static bool cons_setup_request(struct cons_context *ctxt, struct cons_state old) * handover request setup by cons_setup_handover() is now invalidated and * must be performed again). */ -static bool cons_try_acquire_spin(struct cons_context *ctxt) +static int cons_try_acquire_spin(struct cons_context *ctxt) { struct console *con = ctxt->console; struct cons_state cur;
| |