projects
/
contrib
/
mraa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0aac9df
)
i2c.c: Added check for NULL i2c context
author
Henry Bruce
<henry.bruce@intel.com>
Wed, 16 Sep 2015 22:19:20 +0000
(15:19 -0700)
committer
Brendan Le Foll
<brendan.le.foll@intel.com>
Thu, 17 Sep 2015 10:34:35 +0000
(11:34 +0100)
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
src/i2c/i2c.c
patch
|
blob
|
history
diff --git
a/src/i2c/i2c.c
b/src/i2c/i2c.c
index
c305518
..
a870c4f
100644
(file)
--- a/
src/i2c/i2c.c
+++ b/
src/i2c/i2c.c
@@
-336,6
+336,10
@@
mraa_i2c_write_word_data(mraa_i2c_context dev, const uint16_t data, const uint8_
mraa_result_t
mraa_i2c_address(mraa_i2c_context dev, uint8_t addr)
{
+ if (dev == NULL) {
+ return MRAA_ERROR_INVALID_HANDLE;
+ }
+
dev->addr = (int) addr;
if (IS_FUNC_DEFINED(dev, i2c_address_replace)) {
return dev->advance_func->i2c_address_replace(dev, addr);