• Arnd Bergmann's avatar
    net: hns: fix uninitialized data use · a17f1861
    Arnd Bergmann authored
    When dev_dbg() is enabled, we print uninitialized data, as gcc-7.0.1
    now points out:
    
    ethernet/hisilicon/hns/hns_dsaf_main.c: In function 'hns_dsaf_set_promisc_tcam':
    ethernet/hisilicon/hns/hns_dsaf_main.c:2947:75: error: 'tbl_tcam_data.low.val' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    ethernet/hisilicon/hns/hns_dsaf_main.c:2947:75: error: 'tbl_tcam_data.high.val' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    
    We also pass the data into hns_dsaf_tcam_mc_cfg(), which might later
    use it (not sure about that), so it seems safer to just always initialize
    the tbl_tcam_data structure.
    
    Fixes: 1f5fa2dd ("net: hns: fix for promisc mode in HNS driver")
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    a17f1861
hns_dsaf_main.c 92.9 KB