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>
This commit is contained in:
committed by
David S. Miller
parent
5e50732803
commit
01a859014b
@@ -191,6 +191,7 @@ int cfcnfg_disconn_adapt_layer(struct cfcnfg *cnfg, struct cflayer *adap_layer)
|
|||||||
struct cflayer *servl = NULL;
|
struct cflayer *servl = NULL;
|
||||||
struct cfcnfg_phyinfo *phyinfo = NULL;
|
struct cfcnfg_phyinfo *phyinfo = NULL;
|
||||||
u8 phyid = 0;
|
u8 phyid = 0;
|
||||||
|
|
||||||
caif_assert(adap_layer != NULL);
|
caif_assert(adap_layer != NULL);
|
||||||
channel_id = adap_layer->id;
|
channel_id = adap_layer->id;
|
||||||
if (adap_layer->dn == NULL || channel_id == 0) {
|
if (adap_layer->dn == NULL || channel_id == 0) {
|
||||||
@@ -199,16 +200,16 @@ int cfcnfg_disconn_adapt_layer(struct cfcnfg *cnfg, struct cflayer *adap_layer)
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
servl = cfmuxl_remove_uplayer(cnfg->mux, channel_id);
|
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) {
|
if (servl == NULL) {
|
||||||
pr_err("PROTOCOL ERROR - Error removing service_layer Channel_Id(%d)",
|
pr_err("PROTOCOL ERROR - Error removing service_layer Channel_Id(%d)",
|
||||||
channel_id);
|
channel_id);
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto end;
|
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);
|
caif_assert(channel_id == servl->id);
|
||||||
if (adap_layer->dn != NULL) {
|
if (adap_layer->dn != NULL) {
|
||||||
phyid = cfsrvl_getphyid(adap_layer->dn);
|
phyid = cfsrvl_getphyid(adap_layer->dn);
|
||||||
|
Reference in New Issue
Block a user