projects
/
platform
/
upstream
/
connman.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
57fa408
)
session: Policy register should check callback existence
author
Daniel Wagner
<daniel.wagner@bmw-carit.de>
Wed, 31 Oct 2012 09:33:30 +0000
(10:33 +0100)
committer
Patrik Flykt
<patrik.flykt@linux.intel.com>
Mon, 5 Nov 2012 12:42:17 +0000
(14:42 +0200)
Let's ensure that the policy plugin has all necessary callbacks
installed when connman_session_policy_register() is called. The rest
of the code expects that the create() and destroy() callbacks exist
whenever a plugin is used.
src/session.c
patch
|
blob
|
history
diff --git
a/src/session.c
b/src/session.c
index
c981bef
..
2b06e3f
100644
(file)
--- a/
src/session.c
+++ b/
src/session.c
@@
-314,6
+314,9
@@
int connman_session_policy_register(struct connman_session_policy *policy)
{
DBG("name %s", policy->name);
+ if (policy->create == NULL || policy->destroy == NULL)
+ return -EINVAL;
+
policy_list = g_slist_insert_sorted(policy_list, policy,
compare_priority);