Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mt76: mt7921: fix a precision vs width bug in printk

Precision %.*s was intended instead of width %*s. The original code
is potentially an information leak.

Fixes: c7cc5ec57303 ("mt76: mt7921: rework mt7921_mcu_debug_msg_event routine")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>

authored by

Dan Carpenter and committed by
Felix Fietkau
2bf301bc b2bcc6d2

+1 -1
+1 -1
drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
··· 502 502 if (!msg->content[i]) 503 503 msg->content[i] = ' '; 504 504 } 505 - wiphy_info(mt76_hw(dev)->wiphy, "%*s", len, msg->content); 505 + wiphy_info(mt76_hw(dev)->wiphy, "%.*s", len, msg->content); 506 506 } 507 507 } 508 508