diff options
author | Dan Carpenter <error27@gmail.com> | 2011-01-15 03:06:39 +0000 |
---|---|---|
committer | Jonas ABERG <jonas.aberg@stericsson.com> | 2011-04-26 08:29:10 +0200 |
commit | 700a264c810f0ebbff4f54efd48e14bfec314925 (patch) | |
tree | fe5b07938a15114046a7f31fe14eefc75035fcb3 /net | |
parent | 36bca605009f88723ec95a7377e2e0d2242e007b (diff) |
caif: checking the wrong variable
In the original code we check if (servl == NULL) twice. The first time
should print the message that cfmuxl_remove_uplayer() failed and set
"ret" correctly, but instead it just returns success. The second check
should be checking the value of "ret" instead of "servl".
Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Sjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Change-Id: I2dce1dbdd6e283e135f9fdb395bd0b0b1b5a4591
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/21517
Reviewed-by: Erwan BRACQ <erwan.bracq@stericsson.com>
Tested-by: Erwan BRACQ <erwan.bracq@stericsson.com>
Reviewed-by: QATEST
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/caif/cfcnfg.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/caif/cfcnfg.c b/net/caif/cfcnfg.c index 41adafd1891..1bc409a59f8 100644 --- a/net/caif/cfcnfg.c +++ b/net/caif/cfcnfg.c @@ -194,6 +194,7 @@ int cfcnfg_disconn_adapt_layer(struct cfcnfg *cnfg, struct cflayer *adap_layer) struct cflayer *servl = NULL; struct cfcnfg_phyinfo *phyinfo = NULL; u8 phyid = 0; + caif_assert(adap_layer != NULL); channel_id = adap_layer->id; if (adap_layer->dn == NULL || channel_id == 0) { @@ -202,16 +203,16 @@ int cfcnfg_disconn_adapt_layer(struct cfcnfg *cnfg, struct cflayer *adap_layer) goto end; } servl = cfmuxl_remove_uplayer(cnfg->mux, channel_id); - if (servl == NULL) - goto end; - layer_set_up(servl, NULL); - ret = cfctrl_linkdown_req(cnfg->ctrl, channel_id, adap_layer); if (servl == NULL) { pr_err("PROTOCOL ERROR - Error removing service_layer Channel_Id(%d)", channel_id); ret = -EINVAL; goto end; } + layer_set_up(servl, NULL); + ret = cfctrl_linkdown_req(cnfg->ctrl, channel_id, adap_layer); + if (ret) + goto end; caif_assert(channel_id == servl->id); if (adap_layer->dn != NULL) { phyid = cfsrvl_getphyid(adap_layer->dn); |