Message ID | Pine.LNX.4.64.1008161828520.19313@ask.diku.dk |
---|---|
State | Superseded, archived |
Delegated to: | David Miller |
Headers | show |
On Mon, Aug 16, 2010 at 06:29:13PM +0200, Julia Lawall wrote: > From: Julia Lawall <julia@diku.dk> > > The error code is stored in the variable err, but it is the variable ret > that is returned instead. So store the error code in ret. Err is then > useless. Could you redo this for the latest git? (Sorry, I recently made the problem slightly worse by adding another "err = -ENOMEM;")... regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Mon, 16 Aug 2010, Dan Carpenter wrote: > On Mon, Aug 16, 2010 at 06:29:13PM +0200, Julia Lawall wrote: > > From: Julia Lawall <julia@diku.dk> > > > > The error code is stored in the variable err, but it is the variable ret > > that is returned instead. So store the error code in ret. Err is then > > useless. > > Could you redo this for the latest git? (Sorry, I recently made the > problem slightly worse by adding another "err = -ENOMEM;")... Sure. I'll send it shortly. julia -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Julia Lawall <julia@diku.dk> Date: Mon, 16 Aug 2010 18:29:13 +0200 (CEST) > From: Julia Lawall <julia@diku.dk> > > The error code is stored in the variable err, but it is the variable ret > that is returned instead. So store the error code in ret. Err is then > useless. > > The semantic match that finds this problem is as follows: > (http://coccinelle.lip6.fr/) ... > Signed-off-by: Julia Lawall <julia@diku.dk> Applied. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c index b9615bd..142ab1d 100644 --- a/drivers/net/qlcnic/qlcnic_main.c +++ b/drivers/net/qlcnic/qlcnic_main.c @@ -474,7 +474,7 @@ static int qlcnic_init_pci_info(struct qlcnic_adapter *adapter) { struct qlcnic_pci_info pci_info[QLCNIC_MAX_PCI_FUNC]; - int i, ret = 0, err; + int i, ret = 0; u8 pfn; if (!adapter->npars) @@ -487,7 +487,7 @@ qlcnic_init_pci_info(struct qlcnic_adapter *adapter) adapter->eswitch = kzalloc(sizeof(struct qlcnic_eswitch) * QLCNIC_NIU_MAX_XG_PORTS, GFP_KERNEL); if (!adapter->eswitch) { - err = -ENOMEM; + ret = -ENOMEM; goto err_eswitch; }