Re: drivers/infiniband/hw/bnxt_re/qplib_fp.c:1090 bnxt_qplib_create_qp() error: we previously assumed 'res->dattr' could be null (see line 985)
From: Leon Romanovsky
Date: Tue Nov 26 2024 - 08:01:32 EST
On Sat, Nov 23, 2024 at 01:14:25PM +0300, Dan Carpenter wrote:
> [ I reported this last year and generally I try to report only report these
> warnings one time, but it still feels like perhaps a bug. Mostly likely with
> these the NULL check can be removed. But smatch still warns about it even
> with cross function analysis.
> https://lore.kernel.org/all/c2ff81f3-5de6-4498-b157-909d89e74fcb@stanley.mountain/
> -dan ]
<...>
> 07f830ae4913d0 Selvin Xavier 2023-12-07 @985 if (res->dattr)
> ^^^^^^^^^^
> The new code assumes this can be NULL
Yes, this if can be removed. res->dattr != NULL in all places.
Thanks