]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: mt76: connac: Replace memcpy + hard-coded size with strscpy
authorThorsten Blum <thorsten.blum@linux.dev>
Tue, 23 Sep 2025 21:38:31 +0000 (23:38 +0200)
committerFelix Fietkau <nbd@nbd.name>
Mon, 24 Nov 2025 13:37:53 +0000 (14:37 +0100)
Replace memcpy() and the hard-coded string length with strscpy() to
safely copy the string and improve mt76_connac_mcu_chip_config().

No functional changes.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20250923213831.1896823-2-thorsten.blum@linux.dev
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c

index fc3e6728fcfbfb02f7f6bf1274fa5362f1b43221..451375f2901b07e87c0bc0cd06bd24410cd4f6bc 100644 (file)
@@ -1974,7 +1974,7 @@ int mt76_connac_mcu_chip_config(struct mt76_dev *dev)
                .resp_type = 0,
        };
 
-       memcpy(req.data, "assert", 7);
+       strscpy(req.data, "assert");
 
        return mt76_mcu_send_msg(dev, MCU_CE_CMD(CHIP_CONFIG),
                                 &req, sizeof(req), false);