diff mbox series

[2/3] mt76: mt7915: fix a precision vs width bug in printk

Message ID YIAlYknkd0SoD6SY@mwanda (mailing list archive)
State New
Headers show
Series [1/3] mt76: mt7615: fix a precision vs width bug in printk | expand

Commit Message

Dan Carpenter April 21, 2021, 1:15 p.m. UTC
Precision %.*s was intended instead of width %.*s.  The original code
will still print unintended data from beyond the end of skb->data.

Fixes: 665b2c780d63 ("mt76: mt7915: limit firmware log message printk to buffer length")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Johannes Berg April 21, 2021, 1:29 p.m. UTC | #1
On Wed, 2021-04-21 at 16:15 +0300, Dan Carpenter wrote:
> Precision %.*s was intended instead of width %.*s.
> 

typo there, the second instance should say "width %*s" :-)

johannes
Dan Carpenter April 21, 2021, 1:35 p.m. UTC | #2
On Wed, Apr 21, 2021 at 03:29:31PM +0200, Johannes Berg wrote:
> On Wed, 2021-04-21 at 16:15 +0300, Dan Carpenter wrote:
> > Precision %.*s was intended instead of width %.*s.
> > 
> 
> typo there, the second instance should say "width %*s" :-)

The hunter has become the hunted.  *dramatic music.  dah dah dah.*

:P

Thanks.

regards,
dan carpenter
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
index 908e74a6b8e6..94195a1ad3b8 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
@@ -521,7 +521,7 @@  mt7915_mcu_rx_log_message(struct mt7915_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);
 }