mt76: mt7915: fix a precision vs width bug in printk
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 21 Apr 2021 13:40:40 +0000 (16:40 +0300)
committerFelix Fietkau <nbd@nbd.name>
Wed, 21 Apr 2021 18:55:56 +0000 (20:55 +0200)
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>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c

index 92e0c78..b3f14ff 100644 (file)
@@ -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);
 }