* [PATCH] IB/mlx5: Fix a NULL vs IS_ERR() check
@ 2020-03-20 13:26 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2020-03-20 13:26 UTC (permalink / raw)
To: Leon Romanovsky, Yishai Hadas
Cc: Doug Ledford, Jason Gunthorpe, linux-rdma, kernel-janitors
The kzalloc() function returns NULL, not error pointers.
Fixes: 30f2fe40c72b ("IB/mlx5: Introduce UAPIs to manage packet pacing")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/infiniband/hw/mlx5/qos.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/mlx5/qos.c b/drivers/infiniband/hw/mlx5/qos.c
index f822b06e7c9e..cac878a70edb 100644
--- a/drivers/infiniband/hw/mlx5/qos.c
+++ b/drivers/infiniband/hw/mlx5/qos.c
@@ -46,8 +46,8 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_PP_OBJ_ALLOC)(
dev = to_mdev(c->ibucontext.device);
pp_entry = kzalloc(sizeof(*pp_entry), GFP_KERNEL);
- if (IS_ERR(pp_entry))
- return PTR_ERR(pp_entry);
+ if (!pp_entry)
+ return -ENOMEM;
in_ctx = uverbs_attr_get_alloced_ptr(attrs,
MLX5_IB_ATTR_PP_OBJ_ALLOC_CTX);
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] IB/mlx5: Fix a NULL vs IS_ERR() check
@ 2020-03-20 13:26 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2020-03-20 13:26 UTC (permalink / raw)
To: Leon Romanovsky, Yishai Hadas
Cc: Doug Ledford, Jason Gunthorpe, linux-rdma, kernel-janitors
The kzalloc() function returns NULL, not error pointers.
Fixes: 30f2fe40c72b ("IB/mlx5: Introduce UAPIs to manage packet pacing")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/infiniband/hw/mlx5/qos.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/mlx5/qos.c b/drivers/infiniband/hw/mlx5/qos.c
index f822b06e7c9e..cac878a70edb 100644
--- a/drivers/infiniband/hw/mlx5/qos.c
+++ b/drivers/infiniband/hw/mlx5/qos.c
@@ -46,8 +46,8 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_PP_OBJ_ALLOC)(
dev = to_mdev(c->ibucontext.device);
pp_entry = kzalloc(sizeof(*pp_entry), GFP_KERNEL);
- if (IS_ERR(pp_entry))
- return PTR_ERR(pp_entry);
+ if (!pp_entry)
+ return -ENOMEM;
in_ctx = uverbs_attr_get_alloced_ptr(attrs,
MLX5_IB_ATTR_PP_OBJ_ALLOC_CTX);
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] IB/mlx5: Fix a NULL vs IS_ERR() check
2020-03-20 13:26 ` Dan Carpenter
@ 2020-03-20 14:29 ` Leon Romanovsky
-1 siblings, 0 replies; 6+ messages in thread
From: Leon Romanovsky @ 2020-03-20 14:29 UTC (permalink / raw)
To: Dan Carpenter
Cc: Yishai Hadas, Doug Ledford, Jason Gunthorpe, linux-rdma, kernel-janitors
On Fri, Mar 20, 2020 at 04:26:41PM +0300, Dan Carpenter wrote:
> The kzalloc() function returns NULL, not error pointers.
>
> Fixes: 30f2fe40c72b ("IB/mlx5: Introduce UAPIs to manage packet pacing")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> drivers/infiniband/hw/mlx5/qos.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
Of course, thanks a lot.
Acked-by: Leon Romanovsky <leonro@mellanox.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] IB/mlx5: Fix a NULL vs IS_ERR() check
@ 2020-03-20 14:29 ` Leon Romanovsky
0 siblings, 0 replies; 6+ messages in thread
From: Leon Romanovsky @ 2020-03-20 14:29 UTC (permalink / raw)
To: Dan Carpenter
Cc: Yishai Hadas, Doug Ledford, Jason Gunthorpe, linux-rdma, kernel-janitors
On Fri, Mar 20, 2020 at 04:26:41PM +0300, Dan Carpenter wrote:
> The kzalloc() function returns NULL, not error pointers.
>
> Fixes: 30f2fe40c72b ("IB/mlx5: Introduce UAPIs to manage packet pacing")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> drivers/infiniband/hw/mlx5/qos.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
Of course, thanks a lot.
Acked-by: Leon Romanovsky <leonro@mellanox.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] IB/mlx5: Fix a NULL vs IS_ERR() check
2020-03-20 13:26 ` Dan Carpenter
@ 2020-03-24 22:49 ` Jason Gunthorpe
-1 siblings, 0 replies; 6+ messages in thread
From: Jason Gunthorpe @ 2020-03-24 22:49 UTC (permalink / raw)
To: Dan Carpenter
Cc: Leon Romanovsky, Yishai Hadas, Doug Ledford, linux-rdma, kernel-janitors
On Fri, Mar 20, 2020 at 04:26:41PM +0300, Dan Carpenter wrote:
> The kzalloc() function returns NULL, not error pointers.
>
> Fixes: 30f2fe40c72b ("IB/mlx5: Introduce UAPIs to manage packet pacing")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> Acked-by: Leon Romanovsky <leonro@mellanox.com>
> ---
> drivers/infiniband/hw/mlx5/qos.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Applied to for-next, thanks
Jason
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] IB/mlx5: Fix a NULL vs IS_ERR() check
@ 2020-03-24 22:49 ` Jason Gunthorpe
0 siblings, 0 replies; 6+ messages in thread
From: Jason Gunthorpe @ 2020-03-24 22:49 UTC (permalink / raw)
To: Dan Carpenter
Cc: Leon Romanovsky, Yishai Hadas, Doug Ledford, linux-rdma, kernel-janitors
On Fri, Mar 20, 2020 at 04:26:41PM +0300, Dan Carpenter wrote:
> The kzalloc() function returns NULL, not error pointers.
>
> Fixes: 30f2fe40c72b ("IB/mlx5: Introduce UAPIs to manage packet pacing")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> Acked-by: Leon Romanovsky <leonro@mellanox.com>
> ---
> drivers/infiniband/hw/mlx5/qos.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Applied to for-next, thanks
Jason
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-03-24 22:49 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-20 13:26 [PATCH] IB/mlx5: Fix a NULL vs IS_ERR() check Dan Carpenter
2020-03-20 13:26 ` Dan Carpenter
2020-03-20 14:29 ` Leon Romanovsky
2020-03-20 14:29 ` Leon Romanovsky
2020-03-24 22:49 ` Jason Gunthorpe
2020-03-24 22:49 ` Jason Gunthorpe
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.