From b52a6e60c78aa678fe8386c370b30dba422b554e Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Wed, 27 Jan 2010 12:57:16 -0600 Subject: [PATCH] Fix: Remove pointless error labels --- drivers/stemodem/gprs-context.c | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/drivers/stemodem/gprs-context.c b/drivers/stemodem/gprs-context.c index 898e12f5..e30245ff 100644 --- a/drivers/stemodem/gprs-context.c +++ b/drivers/stemodem/gprs-context.c @@ -186,18 +186,15 @@ static gboolean caif_if_create(const char *interface, unsigned int connid) s = socket(AF_CAIF, SOCK_SEQPACKET, CAIFPROTO_AT); if (s < 0) { ofono_debug("Failed to create socket for CAIF interface"); - goto error; + return FALSE; } if (ioctl(s, SIOCCAIFNETNEW, &ifr) < 0) { ofono_debug("Failed to create IP interface for CAIF"); - goto error; + return FALSE; } return TRUE; - -error: - return FALSE; } /* @@ -216,25 +213,21 @@ static gboolean caif_if_remove(const char *interface, unsigned int connid) s = socket(AF_CAIF, SOCK_SEQPACKET, CAIFPROTO_AT); if (s < 0) { ofono_debug("Failed to create socket for CAIF interface"); - goto error; + return FALSE; } - if (ioctl(s, SIOCGIFINDEX, &ifr) == 0) { - if (ioctl(s, SIOCCAIFNETREMOVE, &ifr) < 0) { - ofono_debug("Failed to remove IP interface" - "for CAIF"); - goto error; - } - } else { + if (ioctl(s, SIOCGIFINDEX, &ifr) != 0) { ofono_debug("Did not find interface (%s) to remove", interface); - goto error; + return FALSE; + } + + if (ioctl(s, SIOCCAIFNETREMOVE, &ifr) < 0) { + ofono_debug("Failed to remove IP interface for CAIF"); + return FALSE; } return TRUE; - -error: - return FALSE; } static void ste_eppsd_down_cb(gboolean ok, GAtResult *result,