All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] nfp: abm: fix error return code in nfp_abm_vnic_alloc()
@ 2020-05-08  7:27 ` Wei Yongjun
  0 siblings, 0 replies; 4+ messages in thread
From: Wei Yongjun @ 2020-05-08  7:27 UTC (permalink / raw)
  To: Jakub Kicinski, Qiushi Wu, Jakub Kicinski
  Cc: Wei Yongjun, oss-drivers, netdev, kernel-janitors, Hulk Robot

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.




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

* [PATCH net-next] nfp: abm: fix error return code in nfp_abm_vnic_alloc()
@ 2020-05-08  7:27 ` Wei Yongjun
  0 siblings, 0 replies; 4+ messages in thread
From: Wei Yongjun @ 2020-05-08  7:27 UTC (permalink / raw)
  To: Jakub Kicinski, Qiushi Wu, Jakub Kicinski
  Cc: Wei Yongjun, oss-drivers, netdev, kernel-janitors, Hulk Robot

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.

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

* Re: [PATCH net-next] nfp: abm: fix error return code in nfp_abm_vnic_alloc()
  2020-05-08  7:27 ` Wei Yongjun
@ 2020-05-09  1:42   ` Jakub Kicinski
  -1 siblings, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2020-05-09  1:42 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Qiushi Wu, Jakub Kicinski, oss-drivers, netdev, kernel-janitors,
	Hulk Robot

On Fri, 8 May 2020 07:27:35 +0000 Wei Yongjun wrote:
> 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>

Applied, thanks!

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

* Re: [PATCH net-next] nfp: abm: fix error return code in nfp_abm_vnic_alloc()
@ 2020-05-09  1:42   ` Jakub Kicinski
  0 siblings, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2020-05-09  1:42 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Qiushi Wu, Jakub Kicinski, oss-drivers, netdev, kernel-janitors,
	Hulk Robot

On Fri, 8 May 2020 07:27:35 +0000 Wei Yongjun wrote:
> 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>

Applied, thanks!

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

end of thread, other threads:[~2020-05-09  1:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08  7:27 [PATCH net-next] nfp: abm: fix error return code in nfp_abm_vnic_alloc() Wei Yongjun
2020-05-08  7:27 ` Wei Yongjun
2020-05-09  1:42 ` Jakub Kicinski
2020-05-09  1:42   ` Jakub Kicinski

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.