diff mbox series

IB/mlx5: Check the correct variable in error handling code

Message ID 20190807123236.GA11452@mwanda (mailing list archive)
State Mainlined
Commit e7e6c6320c8c9ed923250cd019e5f9ca0f59b4b8
Headers show
Series IB/mlx5: Check the correct variable in error handling code | expand

Commit Message

Dan Carpenter Aug. 7, 2019, 12:32 p.m. UTC
The code accidentally checks "event_sub" instead of "event_sub->eventfd".

Fixes: 759738537142 ("IB/mlx5: Enable subscription for device events over DEVX")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/infiniband/hw/mlx5/devx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jason Gunthorpe Aug. 7, 2019, 12:59 p.m. UTC | #1
On Wed, Aug 07, 2019 at 03:32:36PM +0300, Dan Carpenter wrote:
> The code accidentally checks "event_sub" instead of "event_sub->eventfd".
> 
> Fixes: 759738537142 ("IB/mlx5: Enable subscription for device events over DEVX")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/infiniband/hw/mlx5/devx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>

Jason
Leon Romanovsky Aug. 7, 2019, 1:15 p.m. UTC | #2
On Wed, Aug 07, 2019 at 03:32:36PM +0300, Dan Carpenter wrote:
> The code accidentally checks "event_sub" instead of "event_sub->eventfd".
>
> Fixes: 759738537142 ("IB/mlx5: Enable subscription for device events over DEVX")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/infiniband/hw/mlx5/devx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Thanks,
Acked-by: Leon Romanovsky <leonro@mellanox.com>
Doug Ledford Aug. 7, 2019, 8:47 p.m. UTC | #3
On Wed, 2019-08-07 at 15:32 +0300, Dan Carpenter wrote:
> The code accidentally checks "event_sub" instead of "event_sub-
> >eventfd".
> 
> Fixes: 759738537142 ("IB/mlx5: Enable subscription for device events
> over DEVX")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks, applied to for-rc.
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/mlx5/devx.c b/drivers/infiniband/hw/mlx5/devx.c
index fd577ffd7864..e24df414fd47 100644
--- a/drivers/infiniband/hw/mlx5/devx.c
+++ b/drivers/infiniband/hw/mlx5/devx.c
@@ -2041,7 +2041,7 @@  static int UVERBS_HANDLER(MLX5_IB_METHOD_DEVX_SUBSCRIBE_EVENT)(
 			event_sub->eventfd =
 				eventfd_ctx_fdget(redirect_fd);
 
-			if (IS_ERR(event_sub)) {
+			if (IS_ERR(event_sub->eventfd)) {
 				err = PTR_ERR(event_sub->eventfd);
 				event_sub->eventfd = NULL;
 				goto err;