Skip to content

Commit e74024b

Browse files
tmlindgregkh
authored andcommitted
tty: n_gsm: Debug output allocation must use GFP_ATOMIC
Dan Carpenter <dan.carpenter@oracle.com> reported the following Smatch warning: drivers/tty/n_gsm.c:720 gsm_data_kick() warn: sleeping in atomic context This is because gsm_control_message() is holding a spin lock so gsm_hex_dump_bytes() needs to use GFP_ATOMIC instead of GFP_KERNEL. Fixes: 925ea0f ("tty: n_gsm: Fix packet data hex dump output") Cc: stable <stable@kernel.org> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Gregory CLEMENT <gregory.clement@bootlin.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Link: https://lore.kernel.org/r/20220523155052.57129-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f2906aa commit e74024b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/tty/n_gsm.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ static void gsm_hex_dump_bytes(const char *fname, const u8 *data,
455455
return;
456456
}
457457

458-
prefix = kasprintf(GFP_KERNEL, "%s: ", fname);
458+
prefix = kasprintf(GFP_ATOMIC, "%s: ", fname);
459459
if (!prefix)
460460
return;
461461
print_hex_dump(KERN_INFO, prefix, DUMP_PREFIX_OFFSET, 16, 1, data, len,

0 commit comments

Comments
 (0)