Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1436282 > unrolled thread

[PATCH] fsl/fman: fix error handling

Started byChristophe JAILLET <christophe.jaillet@wanadoo.fr>
First post2016-07-04 07:50 +0200
Last post2016-07-05 02:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] fsl/fman: fix error handling Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2016-07-04 07:50 +0200
    Re: [PATCH] fsl/fman: fix error handling David Miller <davem@davemloft.net> - 2016-07-05 02:20 +0200

#1436282 — [PATCH] fsl/fman: fix error handling

FromChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Date2016-07-04 07:50 +0200
Subject[PATCH] fsl/fman: fix error handling
Message-ID<rR4Vz-1HH-9@gated-at.bofh.it>
This is likely that checking 'fman->fifo_offset' instead of
'fman->cam_offset' is expected here.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

---

The type of 'fifo_offset' may also need to be changed.
---
 drivers/net/ethernet/freescale/fman/fman.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/fman/fman.c b/drivers/net/ethernet/freescale/fman/fman.c
index 1de2e1e..f634e769 100644
--- a/drivers/net/ethernet/freescale/fman/fman.c
+++ b/drivers/net/ethernet/freescale/fman/fman.c
@@ -2036,7 +2036,7 @@ static int fman_init(struct fman *fman)
 	/* allocate MURAM for FIFO according to total size */
 	fman->fifo_offset = fman_muram_alloc(fman->muram,
 					     fman->state->total_fifo_size);
-	if (IS_ERR_VALUE(fman->cam_offset)) {
+	if (IS_ERR_VALUE(fman->fifo_offset)) {
 		free_init_resources(fman);
 		dev_err(fman->dev, "%s: MURAM alloc for BMI FIFO failed\n",
 			__func__);
-- 
2.7.4

[toc] | [next] | [standalone]


#1436674

FromDavid Miller <davem@davemloft.net>
Date2016-07-05 02:20 +0200
Message-ID<rRmfM-3Zm-17@gated-at.bofh.it>
In reply to#1436282
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Date: Mon,  4 Jul 2016 07:46:42 +0200

> This is likely that checking 'fman->fifo_offset' instead of
> 'fman->cam_offset' is expected here.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> 
> The type of 'fifo_offset' may also need to be changed.

Fix the test rather than trying to force it into the error pointer
macro.

If fifo_offset is not a pointer, then change the test to check for
whatever would be appropriate for values returned from
fman_muram_alloc().

This is a very low quality patch submission, you submitted a "fix"
which added a new build warning and made it obvious that something
else is needed as well here.  You even stated that you realized this.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web