From 3c5bf837fdbd69a48ba934afa6f64a7c13c552b7 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 21 Apr 2021 16:14:40 +0300 Subject: [PATCH] mt76: mt7615: fix a precision vs width bug in printk Precision "%.*s" was intended instead of width "%*s". The original code will print garbage from beyond the end of the skb->data. Fixes: d76d6c3ba2b0 ("mt76: mt7615: limit firmware log message printk to buffer length") Signed-off-by: Dan Carpenter Signed-off-by: Felix Fietkau --- mt7615/mcu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mt7615/mcu.c b/mt7615/mcu.c index 3c1528ed..aa42af9e 100644 --- a/mt7615/mcu.c +++ b/mt7615/mcu.c @@ -453,7 +453,7 @@ mt7615_mcu_rx_log_message(struct mt7615_dev *dev, struct sk_buff *skb) break; } - wiphy_info(mt76_hw(dev)->wiphy, "%s: %*s", type, + wiphy_info(mt76_hw(dev)->wiphy, "%s: %.*s", type, (int)(skb->len - sizeof(*rxd)), data); }