summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox
diff options
context:
space:
mode:
authorInsu Yun <wuninsu@gmail.com>2015-10-15 12:24:09 -0400
committerDavid S. Miller <davem@davemloft.net>2015-10-15 23:31:38 -0700
commit175f8d6746aa4b1dac5ccf576bcbc5488ff21a36 (patch)
tree69a80424c96f25683797ffdc17cb2e58addaf547 /drivers/net/ethernet/mellanox
parente87eb4051efe76b35d0a297db772f5964a001544 (diff)
downloadblackbird-op-linux-175f8d6746aa4b1dac5ccf576bcbc5488ff21a36.tar.gz
blackbird-op-linux-175f8d6746aa4b1dac5ccf576bcbc5488ff21a36.zip
mlx4: corretly check failed allocation
When allocation fails, mlx4_alloc_cmd_mailbox returns -ENOMEM. Since there is no case that mlx4_alloc_cmd_mailbox returns NULL, it needs to be checked by IS_ERR, not IS_ERR_OR_NULL Signed-off-by: Insu Yun <wuninsu@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/mr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/mr.c b/drivers/net/ethernet/mellanox/mlx4/mr.c
index 78f51e103880..93195191f45b 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mr.c
+++ b/drivers/net/ethernet/mellanox/mlx4/mr.c
@@ -318,7 +318,7 @@ int mlx4_mr_hw_get_mpt(struct mlx4_dev *dev, struct mlx4_mr *mmr,
key, NULL);
} else {
mailbox = mlx4_alloc_cmd_mailbox(dev);
- if (IS_ERR_OR_NULL(mailbox))
+ if (IS_ERR(mailbox))
return PTR_ERR(mailbox);
err = mlx4_cmd_box(dev, 0, mailbox->dma, key,
OpenPOWER on IntegriCloud