apa102: fix potential reference of uninitialized memory

Signed-off-by: Jon Trulson <jtrulson@ics.com>
This commit is contained in:
Jon Trulson 2016-10-25 16:31:41 -06:00
parent d9850cf0f6
commit 092f84437f

View File

@ -34,6 +34,7 @@ apa102_context apa102_init(int ledcount, int bus, int cs) {
if(!dev)
return NULL;
memset(dev, 0, sizeof(struct _apa102_context));
dev->leds = ledcount;
// Try to allocate and zero out buffer