mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mlx4: corretly check failed allocation
@ 2015-10-15 16:24 Insu Yun
  2015-10-16  6:31 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Insu Yun @ 2015-10-15 16:24 UTC (permalink / raw)
  To: davem, amirv, maorg, ogerlitz, jackm, yishaih, viro, netdev,
	linux-kernel
  Cc: taesoo, yeongjin.jang, insu, Insu Yun

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>
---
 drivers/net/ethernet/mellanox/mlx4/mr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/mr.c b/drivers/net/ethernet/mellanox/mlx4/mr.c
index 78f51e1..9319519 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,
-- 
1.9.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mlx4: corretly check failed allocation
  2015-10-15 16:24 [PATCH] mlx4: corretly check failed allocation Insu Yun
@ 2015-10-16  6:31 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-10-16  6:31 UTC (permalink / raw)
  To: wuninsu
  Cc: amirv, maorg, ogerlitz, jackm, yishaih, viro, netdev,
	linux-kernel, taesoo, yeongjin.jang, insu

From: Insu Yun <wuninsu@gmail.com>
Date: Thu, 15 Oct 2015 12:24:09 -0400

> 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>

Applied to net-next, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-16  6:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-15 16:24 [PATCH] mlx4: corretly check failed allocation Insu Yun
2015-10-16  6:31 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®