summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Engestrom <eric@engestrom.ch>2017-07-30 21:27:38 +0100
committerEric Engestrom <eric.engestrom@imgtec.com>2017-08-07 14:16:41 +0100
commitac2b806c4556c8339f5eb95578884278b1925acb (patch)
treef65376b03ff1dc1f499cec5341a5cdf907df2bb0
parente2b6785c5abecceee8f3c1830ee1bb22e6d0ef51 (diff)
downloadlibdrm-ac2b806c4556c8339f5eb95578884278b1925acb.tar.gz
libdrm-ac2b806c4556c8339f5eb95578884278b1925acb.tar.bz2
libdrm-ac2b806c4556c8339f5eb95578884278b1925acb.zip
freedreno: remove dead error path
`pipe` cannot be non-null, so the label reduces to a simple return. Then, there is no point initialising `pipe` just to overwrite it before anyone reads it. Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Rob Clark <robdclark@gmail.com>
-rw-r--r--freedreno/freedreno_pipe.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/freedreno/freedreno_pipe.c b/freedreno/freedreno_pipe.c
index 3f8c8342..e69cb28c 100644
--- a/freedreno/freedreno_pipe.c
+++ b/freedreno/freedreno_pipe.c
@@ -36,18 +36,18 @@
struct fd_pipe *
fd_pipe_new(struct fd_device *dev, enum fd_pipe_id id)
{
- struct fd_pipe *pipe = NULL;
+ struct fd_pipe *pipe;
uint64_t val;
if (id > FD_PIPE_MAX) {
ERROR_MSG("invalid pipe id: %d", id);
- goto fail;
+ return NULL;
}
pipe = dev->funcs->pipe_new(dev, id);
if (!pipe) {
ERROR_MSG("allocation failed");
- goto fail;
+ return NULL;
}
pipe->dev = dev;
@@ -57,10 +57,6 @@ fd_pipe_new(struct fd_device *dev, enum fd_pipe_id id)
pipe->gpu_id = val;
return pipe;
-fail:
- if (pipe)
- fd_pipe_del(pipe);
- return NULL;
}
void fd_pipe_del(struct fd_pipe *pipe)