]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: txgbe: initialize module info buffer
authorJiawen Wu <jiawenwu@trustnetic.com>
Mon, 8 Jun 2026 07:08:40 +0000 (15:08 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 11 Jun 2026 08:55:14 +0000 (10:55 +0200)
The module info buffer should be initialized to 0 before the firmware
returns information. Otherwise, there is a risk that the buffer field
not filled by the firmware is random value.

Fixes: 343929799ace ("net: txgbe: Support to handle GPIO IRQs for AML devices")
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
Link: https://patch.msgid.link/20260608070842.36504-2-jiawenwu@trustnetic.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/wangxun/txgbe/txgbe_aml.c

index f0514251d4f342ac03786fbe9ebcf34ff93650b0..a7e81f9e1be1482cc2e49d730a8dbe7b8627b6a1 100644 (file)
@@ -335,7 +335,7 @@ static int txgbe_qsfp_to_linkmodes(struct wx *wx, struct txgbe_sff_id *id)
 
 int txgbe_identify_module(struct wx *wx)
 {
-       struct txgbe_hic_get_module_info buffer;
+       struct txgbe_hic_get_module_info buffer = { 0 };
        struct txgbe_sff_id *id;
        int err = 0;
        u32 mod_abs;