libmemif: external region bugfix
Change-Id: I7dbece80dda917ff78f53f8f4074132895aed316 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
This commit is contained in:

committed by
Damjan Marion

parent
b1be2a0bb8
commit
412e7b64f9
@ -1185,6 +1185,8 @@ memif_disconnect_internal (memif_connection_t * c)
|
||||
|
||||
for (i = 0; i < c->regions_num; i++)
|
||||
{
|
||||
if (&c->regions[i] == NULL)
|
||||
continue;
|
||||
if (c->regions[i].is_external != 0)
|
||||
{
|
||||
lm->del_external_region (c->regions[i].addr,
|
||||
@ -1318,7 +1320,7 @@ memif_connect1 (memif_connection_t * c)
|
||||
if (mr->is_external)
|
||||
{
|
||||
if (lm->get_external_region_addr == NULL)
|
||||
return 99; /* FIXME: propper error report */
|
||||
return 99; /* FIXME: proper error report */
|
||||
mr->addr =
|
||||
lm->get_external_region_addr (mr->region_size, mr->fd,
|
||||
c->private_ctx);
|
||||
|
@ -506,7 +506,8 @@ memif_msg_receive_add_region (memif_connection_t * c, memif_msg_t * msg,
|
||||
c->regions[ar->index].region_size = ar->size;
|
||||
c->regions[ar->index].addr = NULL;
|
||||
|
||||
if (lm->get_external_region_addr)
|
||||
/* region 0 is never external */
|
||||
if (lm->get_external_region_addr && (ar->index != 0))
|
||||
c->regions[ar->index].is_external = 1;
|
||||
|
||||
return MEMIF_ERR_SUCCESS; /* 0 */
|
||||
|
Reference in New Issue
Block a user