All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Yongjun <weiyongjun1@huawei.com>
To: Jakub Kicinski <kuba@kernel.org>, Qiushi Wu <wu000273@umn.edu>,
	"Jakub Kicinski" <jakub.kicinski@netronome.com>
Cc: Wei Yongjun <weiyongjun1@huawei.com>, <oss-drivers@netronome.com>,
	<netdev@vger.kernel.org>, <kernel-janitors@vger.kernel.org>,
	Hulk Robot <hulkci@huawei.com>
Subject: [PATCH net-next] nfp: abm: fix error return code in nfp_abm_vnic_alloc()
Date: Fri, 8 May 2020 07:27:35 +0000	[thread overview]
Message-ID: <20200508072735.61047-1-weiyongjun1@huawei.com> (raw)

Fix to return negative error code -ENOMEM from the kzalloc() error
handling case instead of 0, as done elsewhere in this function.

Fixes: 174ab544e3bc ("nfp: abm: add cls_u32 offload for simple band classification")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/net/ethernet/netronome/nfp/abm/main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/netronome/nfp/abm/main.c b/drivers/net/ethernet/netronome/nfp/abm/main.c
index 354efffac0f9..bdbf0726145e 100644
--- a/drivers/net/ethernet/netronome/nfp/abm/main.c
+++ b/drivers/net/ethernet/netronome/nfp/abm/main.c
@@ -333,8 +333,10 @@ nfp_abm_vnic_alloc(struct nfp_app *app, struct nfp_net *nn, unsigned int id)
 		goto err_free_alink;
 
 	alink->prio_map = kzalloc(abm->prio_map_len, GFP_KERNEL);
-	if (!alink->prio_map)
+	if (!alink->prio_map) {
+		err = -ENOMEM;
 		goto err_free_alink;
+	}
 
 	/* This is a multi-host app, make sure MAC/PHY is up, but don't
 	 * make the MAC/PHY state follow the state of any of the ports.




WARNING: multiple messages have this Message-ID (diff)
From: Wei Yongjun <weiyongjun1@huawei.com>
To: Jakub Kicinski <kuba@kernel.org>, Qiushi Wu <wu000273@umn.edu>,
	Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: Wei Yongjun <weiyongjun1@huawei.com>,
	oss-drivers@netronome.com, netdev@vger.kernel.org,
	kernel-janitors@vger.kernel.org, Hulk Robot <hulkci@huawei.com>
Subject: [PATCH net-next] nfp: abm: fix error return code in nfp_abm_vnic_alloc()
Date: Fri, 08 May 2020 07:27:35 +0000	[thread overview]
Message-ID: <20200508072735.61047-1-weiyongjun1@huawei.com> (raw)

Fix to return negative error code -ENOMEM from the kzalloc() error
handling case instead of 0, as done elsewhere in this function.

Fixes: 174ab544e3bc ("nfp: abm: add cls_u32 offload for simple band classification")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/net/ethernet/netronome/nfp/abm/main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/netronome/nfp/abm/main.c b/drivers/net/ethernet/netronome/nfp/abm/main.c
index 354efffac0f9..bdbf0726145e 100644
--- a/drivers/net/ethernet/netronome/nfp/abm/main.c
+++ b/drivers/net/ethernet/netronome/nfp/abm/main.c
@@ -333,8 +333,10 @@ nfp_abm_vnic_alloc(struct nfp_app *app, struct nfp_net *nn, unsigned int id)
 		goto err_free_alink;
 
 	alink->prio_map = kzalloc(abm->prio_map_len, GFP_KERNEL);
-	if (!alink->prio_map)
+	if (!alink->prio_map) {
+		err = -ENOMEM;
 		goto err_free_alink;
+	}
 
 	/* This is a multi-host app, make sure MAC/PHY is up, but don't
 	 * make the MAC/PHY state follow the state of any of the ports.

             reply	other threads:[~2020-05-08  7:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-08  7:27 Wei Yongjun [this message]
2020-05-08  7:27 ` [PATCH net-next] nfp: abm: fix error return code in nfp_abm_vnic_alloc() Wei Yongjun
2020-05-09  1:42 ` Jakub Kicinski
2020-05-09  1:42   ` Jakub Kicinski

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=20200508072735.61047-1-weiyongjun1@huawei.com \
    --to=weiyongjun1@huawei.com \
    --cc=hulkci@huawei.com \
    --cc=jakub.kicinski@netronome.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.com \
    --cc=wu000273@umn.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.