diff options
author | James Prestwood <james.prestwood@linux.intel.com> | 2018-05-22 13:35:49 -0700 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2018-05-22 15:39:42 -0500 |
commit | 34ff57e08349f195656a7cbc73064ed840d85b30 (patch) | |
tree | cd71b655ed9f89eb003aac803c9f0a83b8e7701c /plugins/udevng.c | |
parent | 1a8960564e1837497bea0865558770ccded70122 (diff) | |
download | ofono-34ff57e08349f195656a7cbc73064ed840d85b30.tar.gz |
plugins: fixed crash in udevng
The return value from ofono_modem_register was not being checked. If this fails
the modem object is not setup and causes a crash. This was specifically seen
when using the mbim driver without having configured with mbim support.
Now the modem object gets destroyed properly if the modem registration fails.
Diffstat (limited to 'plugins/udevng.c')
-rw-r--r-- | plugins/udevng.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/udevng.c b/plugins/udevng.c index cd56fd56..f4bf61cf 100644 --- a/plugins/udevng.c +++ b/plugins/udevng.c @@ -1802,7 +1802,11 @@ static gboolean create_modem(gpointer key, gpointer value, gpointer user_data) if (driver_list[i].setup(modem) == TRUE) { ofono_modem_set_string(modem->modem, "SystemPath", syspath); - ofono_modem_register(modem->modem); + if (ofono_modem_register(modem->modem) < 0) { + DBG("could not register modem '%s'", modem->driver); + return TRUE; + } + return FALSE; } } |