* [PATCH][next] RDMA/mlx5: Fix missing assignment of rc when calling mlx5_ib_dereg_mr
@ 2021-03-16 9:51 Colin King
2021-03-17 17:04 ` Leon Romanovsky
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2021-03-16 9:51 UTC (permalink / raw)
To: Leon Romanovsky, Doug Ledford, Jason Gunthorpe, linux-rdma
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The assignment of the return code to rc when calling mlx5_ib_dereg_mr is
missing and there is an error check on an uninitialized rc. Fix this by
adding in the assignment.
Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: e6fb246ccafb ("RDMA/mlx5: Consolidate MR destruction to mlx5_ib_dereg_mr()")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/infiniband/hw/mlx5/mr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c
index 86ffc7e5ef96..9dcb9fb4eeaa 100644
--- a/drivers/infiniband/hw/mlx5/mr.c
+++ b/drivers/infiniband/hw/mlx5/mr.c
@@ -1946,7 +1946,7 @@ int mlx5_ib_dereg_mr(struct ib_mr *ibmr, struct ib_udata *udata)
mr->mtt_mr = NULL;
}
if (mr->klm_mr) {
- mlx5_ib_dereg_mr(&mr->klm_mr->ibmr, NULL);
+ rc = mlx5_ib_dereg_mr(&mr->klm_mr->ibmr, NULL);
if (rc)
return rc;
mr->klm_mr = NULL;
--
2.30.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH][next] RDMA/mlx5: Fix missing assignment of rc when calling mlx5_ib_dereg_mr
2021-03-16 9:51 [PATCH][next] RDMA/mlx5: Fix missing assignment of rc when calling mlx5_ib_dereg_mr Colin King
@ 2021-03-17 17:04 ` Leon Romanovsky
0 siblings, 0 replies; 2+ messages in thread
From: Leon Romanovsky @ 2021-03-17 17:04 UTC (permalink / raw)
To: Colin King
Cc: Doug Ledford, Jason Gunthorpe, linux-rdma, kernel-janitors,
linux-kernel
On Tue, Mar 16, 2021 at 09:51:17AM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The assignment of the return code to rc when calling mlx5_ib_dereg_mr is
> missing and there is an error check on an uninitialized rc. Fix this by
> adding in the assignment.
>
> Addresses-Coverity: ("Uninitialized scalar variable")
> Fixes: e6fb246ccafb ("RDMA/mlx5: Consolidate MR destruction to mlx5_ib_dereg_mr()")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/infiniband/hw/mlx5/mr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
It was already sent, thanks.
https://lore.kernel.org/linux-rdma/20210314082250.10143-1-leon@kernel.org/
>
> diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c
> index 86ffc7e5ef96..9dcb9fb4eeaa 100644
> --- a/drivers/infiniband/hw/mlx5/mr.c
> +++ b/drivers/infiniband/hw/mlx5/mr.c
> @@ -1946,7 +1946,7 @@ int mlx5_ib_dereg_mr(struct ib_mr *ibmr, struct ib_udata *udata)
> mr->mtt_mr = NULL;
> }
> if (mr->klm_mr) {
> - mlx5_ib_dereg_mr(&mr->klm_mr->ibmr, NULL);
> + rc = mlx5_ib_dereg_mr(&mr->klm_mr->ibmr, NULL);
> if (rc)
> return rc;
> mr->klm_mr = NULL;
> --
> 2.30.2
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-17 17:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-16 9:51 [PATCH][next] RDMA/mlx5: Fix missing assignment of rc when calling mlx5_ib_dereg_mr Colin King
2021-03-17 17:04 ` Leon Romanovsky
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.