ice: Fix freeing uninitialized pointers
authorDan Carpenter <dan.carpenter@linaro.org>
Thu, 21 Mar 2024 14:42:12 +0000 (17:42 +0300)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Wed, 3 Apr 2024 16:15:18 +0000 (09:15 -0700)
commit90ca6956d3834db4060f87700e2fcbb699c4e4fd
treebff0a206bdcf36e1d1acfcb8931c9aefb32aa455
parent0a6380cb4c6b5c1d6dad226ba3130f9090f0ccea
ice: Fix freeing uninitialized pointers

Automatically cleaned up pointers need to be initialized before exiting
their scope.  In this case, they need to be initialized to NULL before
any return statement.

Fixes: 90f821d72e11 ("ice: avoid unnecessary devm_ usage")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_common.c
drivers/net/ethernet/intel/ice/ice_ethtool.c