mirror of
https://github.com/raspberrypi/userland.git
synced 2025-12-06 04:49:12 +00:00
vchiq: Better error handling
Fix the user library to avoid a seg-fault on a duplicate service error, and ensure that errors in the errors in the vchiq_test functional test cause the test to stop.
This commit is contained in:
@@ -1669,7 +1669,8 @@ create_service(VCHIQ_INSTANCE_T instance,
|
|||||||
{
|
{
|
||||||
vcos_mutex_lock(&instance->mutex);
|
vcos_mutex_lock(&instance->mutex);
|
||||||
|
|
||||||
service->lib_handle = VCHIQ_SERVICE_HANDLE_INVALID;
|
if (service)
|
||||||
|
service->lib_handle = VCHIQ_SERVICE_HANDLE_INVALID;
|
||||||
|
|
||||||
vcos_mutex_unlock(&instance->mutex);
|
vcos_mutex_unlock(&instance->mutex);
|
||||||
|
|
||||||
|
|||||||
@@ -1273,6 +1273,7 @@ func_data_test(VCHIQ_SERVICE_HANDLE_T service, int datalen, int align, int serve
|
|||||||
{
|
{
|
||||||
vcos_log_error("%d: Data corrupted at %x-%x (datalen %x, align %x, server_align %x) -> %02x", func_data_test_iter, i - diffs, i - 1, datalen, align, server_align, data[i-1]);
|
vcos_log_error("%d: Data corrupted at %x-%x (datalen %x, align %x, server_align %x) -> %02x", func_data_test_iter, i - diffs, i - 1, datalen, align, server_align, data[i-1]);
|
||||||
VCOS_BKPT;
|
VCOS_BKPT;
|
||||||
|
success = 0;
|
||||||
diffs = 0;
|
diffs = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1280,12 +1281,16 @@ func_data_test(VCHIQ_SERVICE_HANDLE_T service, int datalen, int align, int serve
|
|||||||
{
|
{
|
||||||
vcos_log_error("%d: Data corrupted at %x-%x (datalen %x, align %x, server_align %x) -> %02x", func_data_test_iter, i - diffs, i - 1, datalen, align, server_align, data[i-1]);
|
vcos_log_error("%d: Data corrupted at %x-%x (datalen %x, align %x, server_align %x) -> %02x", func_data_test_iter, i - diffs, i - 1, datalen, align, server_align, data[i-1]);
|
||||||
VCOS_BKPT;
|
VCOS_BKPT;
|
||||||
|
success = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
skip_iter:
|
skip_iter:
|
||||||
func_data_test_iter++;
|
if (success)
|
||||||
return VCHIQ_SUCCESS;
|
{
|
||||||
|
func_data_test_iter++;
|
||||||
|
return VCHIQ_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
error_exit:
|
error_exit:
|
||||||
return VCHIQ_ERROR;
|
return VCHIQ_ERROR;
|
||||||
|
|||||||
Reference in New Issue
Block a user