Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 263223
b: refs/heads/master
c: 588dc91
h: refs/heads/master
i:
  263221: 24aa9d6
  263219: de5d4bb
  263215: badd56a
v: v3
  • Loading branch information
Wang Shaoyan authored and David S. Miller committed Aug 14, 2011
1 parent 5ddb169 commit 1d2c863
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 320f24e482e6b390c608c6afec253405f9ab7436
refs/heads/master: 588dc91151d99e9307c2f9a8468453274fe43ecd
26 changes: 21 additions & 5 deletions trunk/drivers/net/gianfar_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,10 +686,21 @@ static int gfar_ethflow_to_filer_table(struct gfar_private *priv, u64 ethflow, u
{
unsigned int last_rule_idx = priv->cur_filer_idx;
unsigned int cmp_rqfpr;
unsigned int local_rqfpr[MAX_FILER_IDX + 1];
unsigned int local_rqfcr[MAX_FILER_IDX + 1];
unsigned int *local_rqfpr;
unsigned int *local_rqfcr;
int i = 0x0, k = 0x0;
int j = MAX_FILER_IDX, l = 0x0;
int ret = 1;

local_rqfpr = kmalloc(sizeof(unsigned int) * (MAX_FILER_IDX + 1),
GFP_KERNEL);
local_rqfcr = kmalloc(sizeof(unsigned int) * (MAX_FILER_IDX + 1),
GFP_KERNEL);
if (!local_rqfpr || !local_rqfcr) {
pr_err("Out of memory\n");
ret = 0;
goto err;
}

switch (class) {
case TCP_V4_FLOW:
Expand All @@ -706,7 +717,8 @@ static int gfar_ethflow_to_filer_table(struct gfar_private *priv, u64 ethflow, u
break;
default:
pr_err("Right now this class is not supported\n");
return 0;
ret = 0;
goto err;
}

for (i = 0; i < MAX_FILER_IDX + 1; i++) {
Expand All @@ -721,7 +733,8 @@ static int gfar_ethflow_to_filer_table(struct gfar_private *priv, u64 ethflow, u

if (i == MAX_FILER_IDX + 1) {
pr_err("No parse rule found, can't create hash rules\n");
return 0;
ret = 0;
goto err;
}

/* If a match was found, then it begins the starting of a cluster rule
Expand Down Expand Up @@ -765,7 +778,10 @@ static int gfar_ethflow_to_filer_table(struct gfar_private *priv, u64 ethflow, u
priv->cur_filer_idx = priv->cur_filer_idx - 1;
}

return 1;
err:
kfree(local_rqfcr);
kfree(local_rqfpr);
return ret;
}

static int gfar_set_hash_opts(struct gfar_private *priv, struct ethtool_rxnfc *cmd)
Expand Down

0 comments on commit 1d2c863

Please sign in to comment.