* [PATCH][next] RDMA/mlx5: check for error return in flow_rule rather than err
@ 2019-04-12 10:40 ` Colin King
0 siblings, 0 replies; 5+ messages in thread
From: Colin King @ 2019-04-12 10:40 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>
Currently when the call to create_flow_rule_vport_sq fails, the error
check is being performed on err rather than on the return pointer
flow_rule. The return flow_rule maybe NULL (which is not considered
an error) or an error code, so check for the error on flow_rule.
Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: d5ed8ac34cef ("RDMA/mlx5: Move default representors SQ steering to rule to modify QP")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/infiniband/hw/mlx5/qp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index 99ed77e7d7af..98c3241547fd 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -3276,7 +3276,7 @@ static int modify_raw_packet_qp(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp,
flow_rule = create_flow_rule_vport_sq(dev, sq,
raw_qp_param->port);
if (IS_ERR(flow_rule))
- return err;
+ return PTR_ERR(flow_rule);
err = modify_raw_packet_qp_sq(dev->mdev, sq, sq_state,
raw_qp_param, qp->ibqp.pd);
--
2.20.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH][next] RDMA/mlx5: check for error return in flow_rule rather than err
@ 2019-04-12 10:40 ` Colin King
0 siblings, 0 replies; 5+ messages in thread
From: Colin King @ 2019-04-12 10:40 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>
Currently when the call to create_flow_rule_vport_sq fails, the error
check is being performed on err rather than on the return pointer
flow_rule. The return flow_rule maybe NULL (which is not considered
an error) or an error code, so check for the error on flow_rule.
Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: d5ed8ac34cef ("RDMA/mlx5: Move default representors SQ steering to rule to modify QP")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/infiniband/hw/mlx5/qp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index 99ed77e7d7af..98c3241547fd 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -3276,7 +3276,7 @@ static int modify_raw_packet_qp(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp,
flow_rule = create_flow_rule_vport_sq(dev, sq,
raw_qp_param->port);
if (IS_ERR(flow_rule))
- return err;
+ return PTR_ERR(flow_rule);
err = modify_raw_packet_qp_sq(dev->mdev, sq, sq_state,
raw_qp_param, qp->ibqp.pd);
--
2.20.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH][next] RDMA/mlx5: check for error return in flow_rule rather than err
2019-04-12 10:40 ` Colin King
@ 2019-04-12 15:52 ` Leon Romanovsky
-1 siblings, 0 replies; 5+ messages in thread
From: Leon Romanovsky @ 2019-04-12 15:52 UTC (permalink / raw)
To: Colin King
Cc: Doug Ledford, Jason Gunthorpe, linux-rdma, kernel-janitors, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 759 bytes --]
On Fri, Apr 12, 2019 at 11:40:17AM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Currently when the call to create_flow_rule_vport_sq fails, the error
> check is being performed on err rather than on the return pointer
> flow_rule. The return flow_rule maybe NULL (which is not considered
> an error) or an error code, so check for the error on flow_rule.
>
> Addresses-Coverity: ("Uninitialized scalar variable")
> Fixes: d5ed8ac34cef ("RDMA/mlx5: Move default representors SQ steering to rule to modify QP")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/infiniband/hw/mlx5/qp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Thanks,
Acked-by: Leon Romanovsky <leonro@mellanox.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH][next] RDMA/mlx5: check for error return in flow_rule rather than err
@ 2019-04-12 15:52 ` Leon Romanovsky
0 siblings, 0 replies; 5+ messages in thread
From: Leon Romanovsky @ 2019-04-12 15:52 UTC (permalink / raw)
To: Colin King
Cc: Doug Ledford, Jason Gunthorpe, linux-rdma, kernel-janitors, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 759 bytes --]
On Fri, Apr 12, 2019 at 11:40:17AM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Currently when the call to create_flow_rule_vport_sq fails, the error
> check is being performed on err rather than on the return pointer
> flow_rule. The return flow_rule maybe NULL (which is not considered
> an error) or an error code, so check for the error on flow_rule.
>
> Addresses-Coverity: ("Uninitialized scalar variable")
> Fixes: d5ed8ac34cef ("RDMA/mlx5: Move default representors SQ steering to rule to modify QP")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/infiniband/hw/mlx5/qp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Thanks,
Acked-by: Leon Romanovsky <leonro@mellanox.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH][next] RDMA/mlx5: check for error return in flow_rule rather than err
2019-04-12 10:40 ` Colin King
(?)
(?)
@ 2019-04-12 19:00 ` Jason Gunthorpe
-1 siblings, 0 replies; 5+ messages in thread
From: Jason Gunthorpe @ 2019-04-12 19:00 UTC (permalink / raw)
To: Colin King
Cc: Leon Romanovsky, Doug Ledford, linux-rdma, kernel-janitors, linux-kernel
On Fri, Apr 12, 2019 at 11:40:17AM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Currently when the call to create_flow_rule_vport_sq fails, the error
> check is being performed on err rather than on the return pointer
> flow_rule. The return flow_rule maybe NULL (which is not considered
> an error) or an error code, so check for the error on flow_rule.
>
> Addresses-Coverity: ("Uninitialized scalar variable")
> Fixes: d5ed8ac34cef ("RDMA/mlx5: Move default representors SQ steering to rule to modify QP")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/infiniband/hw/mlx5/qp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to for-next, thanks
Jason
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-04-12 19:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-12 10:40 [PATCH][next] RDMA/mlx5: check for error return in flow_rule rather than err Colin King
2019-04-12 10:40 ` Colin King
2019-04-12 15:52 ` Leon Romanovsky
2019-04-12 15:52 ` Leon Romanovsky
2019-04-12 19:00 ` 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.