Re: [PATCH v2][next] RDMA/hns: Fix uninitialized variable bug

From: Jason Gunthorpe
Date: Sun Mar 29 2020 - 10:10:52 EST


On Fri, Mar 27, 2020 at 09:35:39PM -0500, Gustavo A. R. Silva wrote:
> There is a potential execution path in which variable *ret* is returned
> without being properly initialized, previously.
>
> Fix this by initializing variable *ret* to 0.
>
> Addresses-Coverity-ID: 1491917 ("Uninitialized scalar variable")
> Fixes: 2f49de21f3e9 ("RDMA/hns: Optimize mhop get flow for multi-hop addressing")
> Signed-off-by: Gustavo A. R. Silva <gustavo@xxxxxxxxxxxxxx>
> Acked-by: Weihang Li <liweihang@xxxxxxxxxx>
> ---
> Changes in v2:
> - Set ret to 0 instead of -ENODEV. Thanks Weihang Li, for the feedback.
>
> drivers/infiniband/hw/hns/hns_roce_hem.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-next, thanks

Jason