On Thu, Mar 14, 2019 at 9:22 AM Joel Sherrill <[email protected]> wrote:
> ---
> cpukit/libfs/src/pipe/fifo.c | 13 +++++--------
> 1 file changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/cpukit/libfs/src/pipe/fifo.c b/cpukit/libfs/src/pipe/fifo.c
> index 71d5f85..3275e5f 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();
>
you can also remove the 'out:' label, and probably return 0?
> --
> 1.8.3.1
>
> _______________________________________________
> devel mailing list
> [email protected]
> http://lists.rtems.org/mailman/listinfo/devel
>
_______________________________________________
devel mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/devel