Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 266406
b: refs/heads/master
c: 5bb20ed
h: refs/heads/master
v: v3
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Oct 3, 2011
1 parent 507e23d commit 2cd68e1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 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: 64af1bac9b979ae1f2f052742fda06d65f497643
refs/heads/master: 5bb20ed863f8573ecd1956f0ebd2c3d36e6e0585
23 changes: 14 additions & 9 deletions trunk/net/caif/cfcnfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ cfcnfg_add_phy_layer(struct cfcnfg *cnfg, enum cfcnfg_phy_type phy_type,
{
struct cflayer *frml;
struct cflayer *phy_driver = NULL;
struct cfcnfg_phyinfo *phyinfo;
struct cfcnfg_phyinfo *phyinfo = NULL;
int i;
u8 phyid;

Expand All @@ -482,23 +482,25 @@ cfcnfg_add_phy_layer(struct cfcnfg *cnfg, enum cfcnfg_phy_type phy_type,
goto got_phyid;
}
pr_warn("Too many CAIF Link Layers (max 6)\n");
goto out;
goto out_err;

got_phyid:
phyinfo = kzalloc(sizeof(struct cfcnfg_phyinfo), GFP_ATOMIC);
if (!phyinfo)
goto out_err;

switch (phy_type) {
case CFPHYTYPE_FRAG:
phy_driver =
cfserl_create(CFPHYTYPE_FRAG, phyid, stx);
if (!phy_driver)
goto out;
goto out_err;
break;
case CFPHYTYPE_CAIF:
phy_driver = NULL;
break;
default:
goto out;
goto out_err;
}
phy_layer->id = phyid;
phyinfo->pref = pref;
Expand All @@ -512,10 +514,8 @@ cfcnfg_add_phy_layer(struct cfcnfg *cnfg, enum cfcnfg_phy_type phy_type,

frml = cffrml_create(phyid, fcs);

if (!frml) {
kfree(phyinfo);
goto out;
}
if (!frml)
goto out_err;
phyinfo->frm_layer = frml;
layer_set_up(frml, cnfg->mux);

Expand All @@ -531,7 +531,12 @@ cfcnfg_add_phy_layer(struct cfcnfg *cnfg, enum cfcnfg_phy_type phy_type,
}

list_add_rcu(&phyinfo->node, &cnfg->phys);
out:
mutex_unlock(&cnfg->lock);
return;

out_err:
kfree(phy_driver);
kfree(phyinfo);
mutex_unlock(&cnfg->lock);
}
EXPORT_SYMBOL(cfcnfg_add_phy_layer);
Expand Down

0 comments on commit 2cd68e1

Please sign in to comment.