aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2010-08-16 10:23:51 +0000
committerDavid S. Miller <davem@davemloft.net>2010-08-18 14:26:32 -0700
commit900853a4db7098b0e58ddcb732632ac43a7b2148 (patch)
tree9152ef81c79caef6434f077db7b3bf5794e45f96 /drivers/net
parentnet/ax25: Use available error codes (diff)
downloadlinux-dev-900853a4db7098b0e58ddcb732632ac43a7b2148.tar.xz
linux-dev-900853a4db7098b0e58ddcb732632ac43a7b2148.zip
drivers/net/qlcnic: Use available error codes
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/) // <smpl> @r@ local idexpression x; constant C; @@ if (...) { ... x = -C ... when != x ( return <+...x...+>; | return NULL; | return; | * return ...; ) } // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/qlcnic/qlcnic_main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index abd7cd6db6fd..384cc52a9c3e 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;
- int i, ret = 0, err;
+ int i, ret = 0;
u8 pfn;
pci_info = kcalloc(QLCNIC_MAX_PCI_FUNC, sizeof(*pci_info), GFP_KERNEL);
@@ -484,14 +484,14 @@ qlcnic_init_pci_info(struct qlcnic_adapter *adapter)
adapter->npars = kzalloc(sizeof(struct qlcnic_npar_info) *
QLCNIC_MAX_PCI_FUNC, GFP_KERNEL);
if (!adapter->npars) {
- err = -ENOMEM;
+ ret = -ENOMEM;
goto err_pci_info;
}
adapter->eswitch = kzalloc(sizeof(struct qlcnic_eswitch) *
QLCNIC_NIU_MAX_XG_PORTS, GFP_KERNEL);
if (!adapter->eswitch) {
- err = -ENOMEM;
+ ret = -ENOMEM;
goto err_npars;
}