summaryrefslogtreecommitdiff
path: root/gpsd.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2012-05-11 05:42:57 -0400
committerEric S. Raymond <esr@thyrsus.com>2012-05-11 05:42:57 -0400
commit8114c165fd8740067ef56577618297e1eccd8007 (patch)
treed14bf03af31faf9da1fd561763b9067bfa204a09 /gpsd.c
parentc8a5b43df68e0f8abbad02f07fda76085a5370f0 (diff)
downloadgpsd-8114c165fd8740067ef56577618297e1eccd8007.tar.gz
I don't think the NULL case is possible here, but let's make Coverity happy.
Diffstat (limited to 'gpsd.c')
-rw-r--r--gpsd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gpsd.c b/gpsd.c
index 3a7f0bd0..09cdd639 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -1144,7 +1144,7 @@ static void handle_request(struct subscriber_t *sub,
/* user specified a path, try to assign it */
device = find_device(devconf.path);
/* do not optimize away, we need 'device' later on! */
- if (!awaken(device)) {
+ if (device == NULL || !awaken(device)) {
(void)snprintf(reply, replylen,
"{\"class\":\"ERROR\",\"message\":\"Can't open %s.\"}\r\n",
devconf.path);