Commit ed8c6e2d authored by Baohong Liu's avatar Baohong Liu Committed by Anas Nashif
Browse files

samples: grove_lcd: stop the app if device binding fails


Proceed to LCD programming only if device binding succeeds.
Otherwise, dereferencing a NULL pointer will happen. This
was caught by Coverity.

Coverity-CID: 151986

Change-Id: Ibdb658f530203428aa3e53f358e0788fc1502b06
Signed-off-by: default avatarBaohong Liu <baohong.liu@intel.com>
parent c280ce6b
No related merge requests found
Showing with 1 addition and 0 deletions
+1 -0
......@@ -55,6 +55,7 @@ void main(void)
glcd = device_get_binding(GROVE_LCD_NAME);
if (!glcd) {
printk("Grove LCD: Device not found.\n");
return;
}
/* Now configure the LCD the way we want it */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment