---
 gisi/pep.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/gisi/pep.c b/gisi/pep.c
index f1ff589..bea1902 100644
--- a/gisi/pep.c
+++ b/gisi/pep.c
@@ -148,6 +148,8 @@ unsigned g_isi_pep_get_ifindex(const GIsiPEP *pep)
 
 char *g_isi_pep_get_ifname(const GIsiPEP *pep, char *ifname)
 {
-       unsigned ifi = g_isi_pep_get_ifindex(pep);
-       return if_indextoname(ifi, ifname);
+       if (pep->gprs_fd == -1)
+               return NULL;
+
+       return if_indextoname(g_isi_pep_get_ifindex(pep), ifname);
 }
-- 
1.7.0.4

_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono

Reply via email to