public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Jiawen Wu <jiawenwu@trustnetic.com>
Cc: Mengyuan Lou <mengyuanlou@net-swift.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH net-next] net: libwx: fix an error code in wx_alloc_page_pool()
Date: Thu, 9 Feb 2023 16:43:06 +0300	[thread overview]
Message-ID: <Y+T4aoefc1XWvGYb@kili> (raw)

This function always returns success.  We need to preserve the error
code before setting rx_ring->page_pool = NULL.

Fixes: 850b971110b2 ("net: libwx: Allocate Rx and Tx resources")
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
Applies to net-next.

 drivers/net/ethernet/wangxun/libwx/wx_lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/wangxun/libwx/wx_lib.c b/drivers/net/ethernet/wangxun/libwx/wx_lib.c
index 57e1871ea0c6..ca92fe19a663 100644
--- a/drivers/net/ethernet/wangxun/libwx/wx_lib.c
+++ b/drivers/net/ethernet/wangxun/libwx/wx_lib.c
@@ -1745,8 +1745,8 @@ static int wx_alloc_page_pool(struct wx_ring *rx_ring)
 
 	rx_ring->page_pool = page_pool_create(&pp_params);
 	if (IS_ERR(rx_ring->page_pool)) {
-		rx_ring->page_pool = NULL;
 		ret = PTR_ERR(rx_ring->page_pool);
+		rx_ring->page_pool = NULL;
 	}
 
 	return ret;
-- 
2.35.1


             reply	other threads:[~2023-02-09 13:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-09 13:43 Dan Carpenter [this message]
2023-02-11  3:40 ` [PATCH net-next] net: libwx: fix an error code in wx_alloc_page_pool() patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y+T4aoefc1XWvGYb@kili \
    --to=error27@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jiawenwu@trustnetic.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=mengyuanlou@net-swift.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox