uart.c: fix potential use of uninitialized variable
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com> Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
committed by
Brendan Le Foll
parent
98e755d147
commit
822160b7de
@@ -251,6 +251,7 @@ mraa_uart_context
|
|||||||
mraa_uart_init_raw(const char* path)
|
mraa_uart_init_raw(const char* path)
|
||||||
{
|
{
|
||||||
mraa_result_t status = MRAA_SUCCESS;
|
mraa_result_t status = MRAA_SUCCESS;
|
||||||
|
mraa_uart_context dev = NULL;
|
||||||
|
|
||||||
if (!path) {
|
if (!path) {
|
||||||
syslog(LOG_ERR, "uart: device path undefined");
|
syslog(LOG_ERR, "uart: device path undefined");
|
||||||
@@ -258,7 +259,7 @@ mraa_uart_init_raw(const char* path)
|
|||||||
goto init_raw_cleanup;
|
goto init_raw_cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
mraa_uart_context dev = mraa_uart_init_internal(plat == NULL ? NULL : plat->adv_func);
|
dev = mraa_uart_init_internal(plat == NULL ? NULL : plat->adv_func);
|
||||||
if (dev == NULL) {
|
if (dev == NULL) {
|
||||||
syslog(LOG_ERR, "uart: Failed to allocate memory for context");
|
syslog(LOG_ERR, "uart: Failed to allocate memory for context");
|
||||||
status = MRAA_ERROR_NO_RESOURCES;
|
status = MRAA_ERROR_NO_RESOURCES;
|
||||||
|
|||||||
Reference in New Issue
Block a user