diff options
author | Denis Kenzior <denkenz@gmail.com> | 2009-08-14 14:56:47 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-08-14 15:15:06 -0500 |
commit | a6ef7f8711b4cd86225f6b8b59ad5980709eace5 (patch) | |
tree | 2aa4af7a59c7b99ea9758ecc819326b4f75b0406 | |
parent | 622221e90f19379ca931b03e00a9041c3e2bd986 (diff) | |
download | ofono-a6ef7f8711b4cd86225f6b8b59ad5980709eace5.tar.bz2 |
Sanity check the atom register/unregister funcs
-rw-r--r-- | src/modem.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/modem.c b/src/modem.c index 285aa332..8119ea1c 100644 --- a/src/modem.c +++ b/src/modem.c @@ -135,13 +135,18 @@ void *__ofono_atom_get_data(struct ofono_atom *atom) void __ofono_atom_register(struct ofono_atom *atom, void (*unregister)(struct ofono_atom *)) { + if (unregister == NULL) + return; + atom->unregister = unregister; } void __ofono_atom_unregister(struct ofono_atom *atom) { - if (atom->unregister) - atom->unregister(atom); + if (atom->unregister == NULL) + return; + + atom->unregister(atom); } struct ofono_atom *__ofono_modem_find_atom(struct ofono_modem *modem, |