On 20 January 2017 at 11:40, Christophe Milard <christophe.mil...@linaro.org> wrote: > Hence fixing CID 174663
Adding: Fixes https://bugs.linaro.org/show_bug.cgi?id=2827 Makes it easy to track closing a bug > > Signed-off-by: Christophe Milard <christophe.mil...@linaro.org> > --- > platform/linux-generic/_ishm.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/platform/linux-generic/_ishm.c b/platform/linux-generic/_ishm.c > index f889834..8da64a1 100644 > --- a/platform/linux-generic/_ishm.c > +++ b/platform/linux-generic/_ishm.c > @@ -818,7 +818,12 @@ int _odp_ishm_reserve(const char *name, uint64_t size, > int fd, > > /* If a file descriptor is provided, get the real size and map: */ > if (fd >= 0) { > - fstat(fd, &statbuf); > + if (fstat(fd, &statbuf) < 0) { > + close(fd); > + odp_spinlock_unlock(&ishm_tbl->lock); > + ODP_ERR("_ishm_reserve failed (fstat failed).\n"); > + return -1; > + } > len = statbuf.st_size; > /* note that the huge page flag is meningless here as huge > * page is determined by the provided file descriptor: */ > -- > 2.7.4 > -- Mike Holmes Program Manager - Linaro Networking Group Linaro.org │ Open source software for ARM SoCs "Work should be fun and collaborative, the rest follows"