* [PATCH -next] IB/mlx5: Fix return value check in flow_counters_set_data()
@ 2018-06-07 1:47 Wei Yongjun
2018-06-07 5:56 ` Leon Romanovsky
2018-06-08 23:13 ` Jason Gunthorpe
0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2018-06-07 1:47 UTC (permalink / raw)
To: kernel-janitors
In case of error, the function mlx5_fc_create() returns ERR_PTR() and
never returns NULL. The NULL test in the return value check should be
replaced with IS_ERR().
Fixes: 3b3233fbf02e ("IB/mlx5: Add flow counters binding support")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/infiniband/hw/mlx5/main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index e52dd21..f486e92 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -3199,8 +3199,8 @@ static int flow_counters_set_data(struct ib_counters *ibcounters,
if (!mcounters->hw_cntrs_hndl) {
mcounters->hw_cntrs_hndl = mlx5_fc_create(
to_mdev(ibcounters->device)->mdev, false);
- if (!mcounters->hw_cntrs_hndl) {
- ret = -ENOMEM;
+ if (IS_ERR(mcounters->hw_cntrs_hndl)) {
+ ret = PTR_ERR(mcounters->hw_cntrs_hndl);
goto free;
}
hw_hndl = true;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] IB/mlx5: Fix return value check in flow_counters_set_data()
2018-06-07 1:47 [PATCH -next] IB/mlx5: Fix return value check in flow_counters_set_data() Wei Yongjun
@ 2018-06-07 5:56 ` Leon Romanovsky
2018-06-08 23:13 ` Jason Gunthorpe
1 sibling, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2018-06-07 5:56 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 577 bytes --]
On Thu, Jun 07, 2018 at 01:47:41AM +0000, Wei Yongjun wrote:
> In case of error, the function mlx5_fc_create() returns ERR_PTR() and
> never returns NULL. The NULL test in the return value check should be
> replaced with IS_ERR().
>
> Fixes: 3b3233fbf02e ("IB/mlx5: Add flow counters binding support")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/infiniband/hw/mlx5/main.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
Thanks a lot, I thought that I fixed it prior submission, anyway.
Acked-by: Leon Romanovsky <leonro@mellanox.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] IB/mlx5: Fix return value check in flow_counters_set_data()
2018-06-07 1:47 [PATCH -next] IB/mlx5: Fix return value check in flow_counters_set_data() Wei Yongjun
2018-06-07 5:56 ` Leon Romanovsky
@ 2018-06-08 23:13 ` Jason Gunthorpe
1 sibling, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2018-06-08 23:13 UTC (permalink / raw)
To: kernel-janitors
On Thu, Jun 07, 2018 at 01:47:41AM +0000, weiyongjun (A) wrote:
> In case of error, the function mlx5_fc_create() returns ERR_PTR() and
> never returns NULL. The NULL test in the return value check should be
> replaced with IS_ERR().
>
> Fixes: 3b3233fbf02e ("IB/mlx5: Add flow counters binding support")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> Acked-by: Leon Romanovsky <leonro@mellanox.com>
> ---
> drivers/infiniband/hw/mlx5/main.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Applied to for-rc, thanks
Jason
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-06-08 23:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-07 1:47 [PATCH -next] IB/mlx5: Fix return value check in flow_counters_set_data() Wei Yongjun
2018-06-07 5:56 ` Leon Romanovsky
2018-06-08 23:13 ` Jason Gunthorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox