fbarray: check for open failure
Coverity issue: 272564 Fixes: c44d09811b40 ("eal: add shared indexed file-backed array") Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
This commit is contained in:
parent
9d3ba1e0ad
commit
2bcbc4d12c
@ -594,6 +594,11 @@ rte_fbarray_destroy(struct rte_fbarray *arr)
|
||||
eal_get_fbarray_path(path, sizeof(path), arr->name);
|
||||
|
||||
fd = open(path, O_RDONLY);
|
||||
if (fd < 0) {
|
||||
RTE_LOG(ERR, EAL, "Could not open fbarray file: %s\n",
|
||||
strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
if (flock(fd, LOCK_EX | LOCK_NB)) {
|
||||
RTE_LOG(DEBUG, EAL, "Cannot destroy fbarray - another process is using it\n");
|
||||
rte_errno = EBUSY;
|
||||
|
Loading…
x
Reference in New Issue
Block a user