summaryrefslogtreecommitdiff
path: root/src/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/session.c')
-rw-r--r--src/session.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/session.c b/src/session.c
index e4897424..c981befa 100644
--- a/src/session.c
+++ b/src/session.c
@@ -220,18 +220,13 @@ static char *service2bearer(enum connman_service_type type)
static int assign_policy_plugin(struct connman_session *session)
{
- GSList *list;
- struct connman_session_policy *policy;
-
if (session->policy != NULL)
return -EALREADY;
- for (list = policy_list; list != NULL; list = list->next) {
- policy = list->data;
+ if (policy_list == NULL)
+ return 0;
- session->policy = policy;
- break;
- }
+ session->policy = policy_list->data;
return 0;
}