mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
lm35: fix potential reference of uninitialized memory
Signed-off-by: Jon Trulson <jtrulson@ics.com>
This commit is contained in:
parent
bfe64789b6
commit
99abe95a97
@ -23,6 +23,7 @@
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include "lm35.h"
|
||||
|
||||
lm35_context lm35_init(int pin, float aref)
|
||||
@ -33,6 +34,8 @@ lm35_context lm35_init(int pin, float aref)
|
||||
if (!dev)
|
||||
return NULL;
|
||||
|
||||
memset((void *)dev, 0, sizeof(struct _lm35_context));
|
||||
|
||||
// make sure MRAA is initialized
|
||||
int mraa_rv;
|
||||
if ((mraa_rv = mraa_init()) != MRAA_SUCCESS)
|
||||
|
Loading…
x
Reference in New Issue
Block a user