This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, cloud-dev has been updated via 76edf89deaf0fa126f34b6cd58f4373d211f0c33 (commit) from f2a1712bdb379b2eb2c6e470a2f2d9a1302f344f (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 76edf89deaf0fa126f34b6cd58f4373d211f0c33 Author: Josep Puigdemont josep.puigdemont@linaro.org Date: Tue Jun 13 10:06:25 2017 +0200
drv: driver: fix devio registration race
This fixes a race condition that could arise when registering a devio.
Signed-off-by: Josep Puigdemont josep.puigdemont@linaro.org
diff --git a/platform/linux-generic/drv_driver.c b/platform/linux-generic/drv_driver.c index 46cbdba9..3c918def 100644 --- a/platform/linux-generic/drv_driver.c +++ b/platform/linux-generic/drv_driver.c @@ -529,7 +529,7 @@ odpdrv_devio_t odpdrv_devio_register(odpdrv_devio_param_t *param) * sure no devio providing the same interface using th esame enumerator * already exists: */ - devio_list_read_lock(); + devio_list_write_lock(); devio = devio_lst.head; while (devio) { if ((strncmp(param->api_name, devio->param.api_name, @@ -539,12 +539,11 @@ odpdrv_devio_t odpdrv_devio_register(odpdrv_devio_param_t *param) ODP_ERR("a devio providing interface '%s' for devices " "of type '%s' is already registered\n!", param->api_name, param->enumr_api_name); - devio_list_read_unlock(); + devio_list_write_unlock(); return ODPDRV_DEVIO_INVALID; } devio = devio->next; } - devio_list_read_unlock();
/* allocate memory for the new devio: * If init_global has not been done yet, then, we cannot allocate @@ -561,13 +560,16 @@ odpdrv_devio_t odpdrv_devio_register(odpdrv_devio_param_t *param)
if (init_global_status == UNDONE) { devio = malloc(sizeof(_odpdrv_devio_t)); - if (!devio) + if (!devio) { + devio_list_write_unlock(); return ODPDRV_DEVIO_INVALID; + } devio->pool = NULL; } else { devio = _odp_ishm_pool_alloc(list_elt_pool, sizeof(_odpdrv_devio_t)); if (!devio) { + devio_list_write_unlock(); ODP_ERR("_odp_ishm_pool_alloc failed!\n"); return ODPDRV_DEVIO_INVALID; } @@ -576,7 +578,6 @@ odpdrv_devio_t odpdrv_devio_register(odpdrv_devio_param_t *param)
/* save init parameters and insert devio in list */ devio->param = *param; - devio_list_write_lock(); devio->next = devio_lst.head; devio_lst.head = devio; devio_list_write_unlock();
-----------------------------------------------------------------------
Summary of changes: platform/linux-generic/drv_driver.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
hooks/post-receive