diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2014-06-10 14:11:35 +0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2014-06-13 15:43:45 +0300 |
commit | fb36e4983c533eb972eb9a673f6d4d803e07f05a (patch) | |
tree | 7f36940c2af7c1d8ee1e0b3a1311a266f6c98cf5 /profiles/health | |
parent | 32b52153ec83f9c7d360a1e590e55abfa8ced57d (diff) | |
download | bluez-fb36e4983c533eb972eb9a673f6d4d803e07f05a.tar.gz |
HDP: Set error message on error condition
Fixes clang warning:
...
CC profiles/health/bluetoothd-hdp.o
profiles/health/hdp.c:1778:13: warning: Access to field 'message'
results in a dereference of a null pointer (loaded from variable 'gerr')
"%s", gerr->message);
^~~~~~~~~~~~~
...
Diffstat (limited to 'profiles/health')
-rw-r--r-- | profiles/health/hdp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/profiles/health/hdp.c b/profiles/health/hdp.c index 23ab59a90..d64edb8ff 100644 --- a/profiles/health/hdp.c +++ b/profiles/health/hdp.c @@ -747,8 +747,11 @@ static struct hdp_channel *create_channel(struct hdp_device *dev, { struct hdp_channel *hdp_chann; - if (dev == NULL) + if (dev == NULL) { + g_set_error(err, HDP_ERROR, HDP_UNSPECIFIED_ERROR, + "HDP device uninitialized"); return NULL; + } hdp_chann = g_new0(struct hdp_channel, 1); hdp_chann->config = config; |