2021-03-28 12:32:30

by Felix Fietkau

[permalink] [raw]
Subject: [PATCH 1/2] mt76: mt7615: limit firmware log message printk to buffer length

Avoid including garbage from previous rx data

Signed-off-by: Felix Fietkau <[email protected]>
---
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
index 3855acbd4a5d..600c5366c099 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
@@ -424,7 +424,8 @@ mt7615_mcu_rx_log_message(struct mt7615_dev *dev, struct sk_buff *skb)
break;
}

- wiphy_info(mt76_hw(dev)->wiphy, "%s: %s", type, data);
+ wiphy_info(mt76_hw(dev)->wiphy, "%s: %*s", type,
+ (int)(skb->len - sizeof(*rxd)), data);
}

static void
--
2.30.1


2021-03-28 12:33:24

by Felix Fietkau

[permalink] [raw]
Subject: [PATCH 2/2] mt76: mt7915: limit firmware log message printk to buffer length

Avoid including garbage from previous rx data

Signed-off-by: Felix Fietkau <[email protected]>
---
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
index 9d0911ac1d90..67b1426e98b6 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
@@ -521,7 +521,8 @@ mt7915_mcu_rx_log_message(struct mt7915_dev *dev, struct sk_buff *skb)
break;
}

- wiphy_info(mt76_hw(dev)->wiphy, "%s: %s", type, data);
+ wiphy_info(mt76_hw(dev)->wiphy, "%s: %*s", type,
+ (int)(skb->len - sizeof(*rxd)), data);
}

static void
--
2.30.1