Skip to content

Commit 175f8d6

Browse files
insuyundavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e87eb40 commit 175f8d6

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/ethernet/mellanox/mlx4

1 file changed

+1
-1
lines changed

drivers/net/ethernet/mellanox/mlx4/mr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ int mlx4_mr_hw_get_mpt(struct mlx4_dev *dev, struct mlx4_mr *mmr,
318318
key, NULL);
319319
} else {
320320
mailbox = mlx4_alloc_cmd_mailbox(dev);
321-
if (IS_ERR_OR_NULL(mailbox))
321+
if (IS_ERR(mailbox))
322322
return PTR_ERR(mailbox);
323323

324324
err = mlx4_cmd_box(dev, 0, mailbox->dma, key,

0 commit comments

Comments
 (0)