[Intel-wired-lan] [PATCH net-next 2/6] ice: always check VF VSI pointer values
Paul Menzel
pmenzel at molgen.mpg.de
Tue Apr 12 05:38:43 UTC 2022
Dear Jacob,
Thank you for the patch.
Am 12.04.22 um 01:29 schrieb Jacob Keller:
> The ice_get_vf_vsi function can return NULL in some cases, such as if
> handling messages during a reset where the VSI is being removed and
> recreated.
>
> Several places throughout the driver do not bother to check whether this
> VSI pointer is valid. Static analysis tools maybe report issues because
> they detect paths where a potentially NULL pointer could be
> dereferenced.
(side note: scripts/checkpatch.pl checks for 75 characters per line, and
you seem to use 72 characters per line.)
> Fix this by checking the return value of ice_get_vf_vsi everywhere.
I didn’t understand, when WARN_ON() is necessary, and when not, but
looks fine.
> Signed-off-by: Jacob Keller <jacob.e.keller at intel.com>
> ---
> drivers/net/ethernet/intel/ice/ice_devlink.c | 5 ++-
> drivers/net/ethernet/intel/ice/ice_repr.c | 7 +++-
> drivers/net/ethernet/intel/ice/ice_sriov.c | 32 +++++++++++++++++--
> drivers/net/ethernet/intel/ice/ice_vf_lib.c | 28 +++++++++++++++-
> drivers/net/ethernet/intel/ice/ice_virtchnl.c | 5 +++
> .../ethernet/intel/ice/ice_virtchnl_fdir.c | 7 +++-
> 6 files changed, 77 insertions(+), 7 deletions(-)
[…]
Reviewed-by: Paul Menzel <pmenzel at molgen.mpg.de>
Kind regards,
Paul
More information about the Intel-wired-lan
mailing list