diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2008-12-18 00:11:05 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2008-12-18 00:11:05 +0100 |
commit | 0f461fae5f251b9598b4b470f52ca9af575c0cc2 (patch) | |
tree | c16902967b077aec65cff9825702c6b909fb83a9 /plugins/ethernet.c | |
parent | 6e8f721b4b86da751efcdbfdec4ccf526f1cba34 (diff) | |
download | connman-0f461fae5f251b9598b4b470f52ca9af575c0cc2.tar.gz connman-0f461fae5f251b9598b4b470f52ca9af575c0cc2.tar.bz2 connman-0f461fae5f251b9598b4b470f52ca9af575c0cc2.zip |
Handle element registration failures
Diffstat (limited to 'plugins/ethernet.c')
-rw-r--r-- | plugins/ethernet.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/ethernet.c b/plugins/ethernet.c index 832d636f..9cfa76bd 100644 --- a/plugins/ethernet.c +++ b/plugins/ethernet.c @@ -76,7 +76,8 @@ static void ethernet_newlink(unsigned short type, int index, netdev->subtype = CONNMAN_ELEMENT_SUBTYPE_NETWORK; netdev->index = element->index; - connman_element_register(netdev, element); + if (connman_element_register(netdev, element) < 0) + connman_element_unref(netdev); } } else { DBG("carrier off"); |