[Intel-wired-lan] [PATCH iwl-net] idpf: remove redundant 'req_vec_chunks' NULL check

Singh, Krishneil K krishneil.k.singh at intel.com
Mon Aug 5 17:27:31 UTC 2024


> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces at osuosl.org> On Behalf Of
> Pavan Kumar Linga
> Sent: Wednesday, July 24, 2024 2:30 PM
> To: intel-wired-lan at lists.osuosl.org
> Cc: Linga, Pavan Kumar <pavan.kumar.linga at intel.com>; Dan Carpenter
> <dan.carpenter at linaro.org>
> Subject: [Intel-wired-lan] [PATCH iwl-net] idpf: remove redundant
> 'req_vec_chunks' NULL check
> 
> 'req_vec_chunks' is used to store the vector info received
> from the device control plane. The memory for it is allocated
> in idpf_send_alloc_vectors_msg and returns an error if the memory
> allocation fails.
> 
> 'req_vec_chunks' cannot be NULL in the later code flow. So remove
> the conditional check to extract the vector ids received from
> the device control plane.
> 
> Smatch static checker warning:
> 
> drivers/net/ethernet/intel/idpf/idpf_lib.c:417 idpf_intr_req()
> error: we previously assumed 'adapter->req_vec_chunks'
> could be null (see line 360)
> 
> Fixes: 4930fbf419a7 ("idpf: add core init and interrupt request")
> Reported-by: Dan Carpenter <dan.carpenter at linaro.org>
> Reviewed-by: Dan Carpenter <dan.carpenter at linaro.org>
> Signed-off-by: Pavan Kumar Linga <pavan.kumar.linga at intel.com>
> ---
>  drivers/net/ethernet/intel/idpf/idpf_lib.c | 23 +++++-----------------
>  1 file changed, 5 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/idpf/idpf_lib.c
> b/drivers/net/ethernet/intel/idpf/idpf_lib.c
> index 5dbf2b4ba1b0..a56ea36fa8d5 100644
> --- a/drivers/net/ethernet/intel/idpf/idpf_lib.c
> +++ b/drivers/net/ethernet/intel/idpf/idpf_lib.c

Tested-by: Krishneil Singh <krishneil.k.singh at intel.com>



More information about the Intel-wired-lan mailing list