• Jacob Keller's avatar
    fm10k: fix possible null pointer deref after kcalloc · 540a5d85
    Jacob Keller authored
    When writing a new default redirection table, we needed to populate
    a new RSS table using ethtool_rxfh_indir_default. We populated this
    table into a region of memory allocated using kcalloc, but never checked
    this for NULL. Fix this by moving the default table generation into
    fm10k_write_reta. If this function is passed a table, use it. Otherwise,
    generate the default table using ethtool_rxfh_indir_default, 4 at at
    time.
    
    Fixes: 0ea7fae4 ("fm10k: use ethtool_rxfh_indir_default for default redirection table")
    Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
    Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
    540a5d85
fm10k_ethtool.c 30.9 KB