aboutsummaryrefslogtreecommitdiffstats
path: root/net/caif/cfcnfg.c
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2011-01-14 22:06:39 -0500
committerDavid S. Miller <davem@davemloft.net>2011-01-15 23:58:11 -0500
commit01a859014b35deb6cc63b1dc2808ca7a0e10a4de (patch)
tree28334f820b4ce3218a643cda0967aaf63886f4a0 /net/caif/cfcnfg.c
parent5e5073280379d38e86ade471daa7443b553fc839 (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>
Diffstat (limited to 'net/caif/cfcnfg.c')
-rw-r--r--net/caif/cfcnfg.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/caif/cfcnfg.c b/net/caif/cfcnfg.c
index 21ede141018a..c665de778b60 100644
--- a/net/caif/cfcnfg.c
+++ b/net/caif/cfcnfg.c
@@ -191,6 +191,7 @@ int cfcnfg_disconn_adapt_layer(struct cfcnfg *cnfg, struct cflayer *adap_layer)
191 struct cflayer *servl = NULL; 191 struct cflayer *servl = NULL;
192 struct cfcnfg_phyinfo *phyinfo = NULL; 192 struct cfcnfg_phyinfo *phyinfo = NULL;
193 u8 phyid = 0; 193 u8 phyid = 0;
194
194 caif_assert(adap_layer != NULL); 195 caif_assert(adap_layer != NULL);
195 channel_id = adap_layer->id; 196 channel_id = adap_layer->id;
196 if (adap_layer->dn == NULL || channel_id == 0) { 197 if (adap_layer->dn == NULL || channel_id == 0) {
@@ -199,16 +200,16 @@ int cfcnfg_disconn_adapt_layer(struct cfcnfg *cnfg, struct cflayer *adap_layer)
199 goto end; 200 goto end;
200 } 201 }
201 servl = cfmuxl_remove_uplayer(cnfg->mux, channel_id); 202 servl = cfmuxl_remove_uplayer(cnfg->mux, channel_id);
202 if (servl == NULL)
203 goto end;
204 layer_set_up(servl, NULL);
205 ret = cfctrl_linkdown_req(cnfg->ctrl, channel_id, adap_layer);
206 if (servl == NULL) { 203 if (servl == NULL) {
207 pr_err("PROTOCOL ERROR - Error removing service_layer Channel_Id(%d)", 204 pr_err("PROTOCOL ERROR - Error removing service_layer Channel_Id(%d)",
208 channel_id); 205 channel_id);
209 ret = -EINVAL; 206 ret = -EINVAL;
210 goto end; 207 goto end;
211 } 208 }
209 layer_set_up(servl, NULL);
210 ret = cfctrl_linkdown_req(cnfg->ctrl, channel_id, adap_layer);
211 if (ret)
212 goto end;
212 caif_assert(channel_id == servl->id); 213 caif_assert(channel_id == servl->id);
213 if (adap_layer->dn != NULL) { 214 if (adap_layer->dn != NULL) {
214 phyid = cfsrvl_getphyid(adap_layer->dn); 215 phyid = cfsrvl_getphyid(adap_layer->dn);