aboutsummaryrefslogtreecommitdiffstats
path: root/extras/libmemif/src/main.c
diff options
context:
space:
mode:
authorJakub Grajciar <jgrajcia@cisco.com>2018-09-27 10:26:35 +0200
committerDamjan Marion <dmarion@me.com>2018-09-27 18:32:22 +0000
commit412e7b64f9c0b3d5802eee4cd219daff2fcd3dd6 (patch)
tree16e0f848f98aef7c2f3db82d2e7dd9072eb7ed04 /extras/libmemif/src/main.c
parentb1be2a0bb8d9a72bf0b868befaf5e966b9c26edb (diff)
libmemif: external region bugfix
Change-Id: I7dbece80dda917ff78f53f8f4074132895aed316 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Diffstat (limited to 'extras/libmemif/src/main.c')
-rw-r--r--extras/libmemif/src/main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/extras/libmemif/src/main.c b/extras/libmemif/src/main.c
index 338292508c8..782442d440b 100644
--- a/extras/libmemif/src/main.c
+++ b/extras/libmemif/src/main.c
@@ -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);