[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPgLHd8qwuJ4ry-DVExF7mv83FBqYts_7wMO8xikdeL+3e+yUw@mail.gmail.com>
Date: Mon, 23 Sep 2013 10:47:55 +0800
From: Wei Yongjun <weiyj.lk@...il.com>
To: jeffrey.t.kirsher@...el.com, jesse.brandeburg@...el.com,
bruce.w.allan@...el.com, carolyn.wyborny@...el.com,
donald.c.skidmore@...el.com, gregory.v.rose@...el.com,
peter.p.waskiewicz.jr@...el.com, alexander.h.duyck@...el.com,
john.ronciak@...el.com, tushar.n.dave@...el.com,
shannon.nelson@...el.com
Cc: yongjun_wei@...ndmicro.com.cn, e1000-devel@...ts.sourceforge.net,
netdev@...r.kernel.org
Subject: [PATCH] i40e: fix error return code in i40e_probe()
From: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
Fix to return -ENOMEM in the memory alloc error handling
case instead of 0, as done elsewhere in this function.
Signed-off-by: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 601d482..117e014 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -7060,8 +7060,10 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
*/
len = sizeof(struct i40e_vsi *) * pf->hw.func_caps.num_vsis;
pf->vsi = kzalloc(len, GFP_KERNEL);
- if (!pf->vsi)
+ if (!pf->vsi) {
+ err = -ENOMEM;
goto err_switch_setup;
+ }
err = i40e_setup_pf_switch(pf);
if (err) {
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists