aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Efremov <sem@altlinux.org>2017-04-12 19:32:34 +0300
committerAleksander Morgado <aleksander@aleksander.es>2017-04-14 23:41:00 +0200
commit07da0340043b3b4d3ffc005e0a10b4776157a0fe (patch)
tree8e1f12868d71c1a9d9857eef6de979cfa2aa1704
parente35eb212d12c18e111b2ff9eb7580cc96e24f4dc (diff)
downloadexternal_libqmi-07da0340043b3b4d3ffc005e0a10b4776157a0fe.zip
external_libqmi-07da0340043b3b4d3ffc005e0a10b4776157a0fe.tar.gz
external_libqmi-07da0340043b3b4d3ffc005e0a10b4776157a0fe.tar.bz2
utils: drop useless g_file_test() call
canonicalize_file_name() returns NULL if file doesn't exist, so no need to check file existence with g_file_test().
-rw-r--r--src/libqmi-glib/qmi-utils.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libqmi-glib/qmi-utils.c b/src/libqmi-glib/qmi-utils.c
index 29e5f22..5d399a6 100644
--- a/src/libqmi-glib/qmi-utils.c
+++ b/src/libqmi-glib/qmi-utils.c
@@ -743,8 +743,10 @@ __qmi_utils_get_driver (const gchar *cdc_wdm_path)
path = canonicalize_file_name (tmp);
g_free (tmp);
- if (g_file_test (path, G_FILE_TEST_EXISTS))
- driver = g_path_get_basename (path);
+ if (!path)
+ continue;
+
+ driver = g_path_get_basename (path);
g_free (path);
}