summaryrefslogtreecommitdiffstats
path: root/cpukit/libfs
diff options
context:
space:
mode:
authorJoel Sherrill <joel@rtems.org>2019-03-13 10:06:45 -0500
committerJoel Sherrill <joel@rtems.org>2019-03-14 08:21:44 -0500
commit11eb818e88cf6ac04aa19de411bec151fd11bbdb (patch)
tree065de440cb547e10a3988819eebe2e92bce8329e /cpukit/libfs
parentz85c30.c: Do not process 0 baud and return an error (CID 1399713) (diff)
downloadrtems-11eb818e88cf6ac04aa19de411bec151fd11bbdb.tar.bz2
fifo.c: Eliminate logically dead code (Coverity 1437635)
Diffstat (limited to 'cpukit/libfs')
-rw-r--r--cpukit/libfs/src/pipe/fifo.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/cpukit/libfs/src/pipe/fifo.c b/cpukit/libfs/src/pipe/fifo.c
index 71d5f8598a..3275e5f1fd 100644
--- a/cpukit/libfs/src/pipe/fifo.c
+++ b/cpukit/libfs/src/pipe/fifo.c
@@ -149,18 +149,15 @@ static int pipe_new(
pipe = *pipep;
if (pipe == NULL) {
err = pipe_alloc(&pipe);
- if (err)
- goto out;
+ if (err) {
+ pipe_unlock();
+ return err;
+ }
}
PIPE_LOCK(pipe);
- if (*pipep == NULL) {
- if (err)
- pipe_free(pipe);
- else
- *pipep = pipe;
- }
+ *pipep = pipe;
out:
pipe_unlock();