samples: button: stop the app if device binding fails
Stop the app from running if device binding fails. Otherwise, dereferencing NULL pointer will happen. This was caught by Coverity. Coverity-CID: 151988 Change-Id: I8245d938498a51123249fbd069935900ad660314 Signed-off-by: Baohong Liu <baohong.liu@intel.com>
This commit is contained in:
parent
8d2a511557
commit
2ca689da91
|
@ -62,6 +62,7 @@ void main(void)
|
|||
gpiob = device_get_binding(PORT);
|
||||
if (!gpiob) {
|
||||
printk("error\n");
|
||||
return;
|
||||
}
|
||||
|
||||
gpio_pin_configure(gpiob, PIN,
|
||||
|
|
Loading…
Reference in a new issue