From: Su Hui <suhui@nfschina.com>
To: kherbst@redhat.com, lyude@redhat.com, dakr@redhat.com,
airlied@gmail.com, daniel@ffwll.ch, nathan@kernel.org,
ndesaulniers@google.com, morbo@google.com,
justinstitt@google.com
Cc: Su Hui <suhui@nfschina.com>,
bskeggs@redhat.com, airlied@redhat.com,
dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev,
kernel-janitors@vger.kernel.org
Subject: [PATCH] drm/nouveau/disp: fix an error problem in nvkm_uconn_new()
Date: Wed, 17 Apr 2024 16:39:21 +0800 [thread overview]
Message-ID: <20240417083920.2256027-1-suhui@nfschina.com> (raw)
Clang Static Checker(scan-build) Warning:
drivers/gpu/drm/nouveau/nvkm/engine/disp/uconn.c:line 215, column 4
Value stored to 'ret' is never read.
Return the error code rather than zero when 'conn->info.type' has an
unknown type.
Fixes: 8b7d92cad953 ("drm/nouveau/kms/nv50-: create connectors based on nvkm info")
Signed-off-by: Su Hui <suhui@nfschina.com>
---
drivers/gpu/drm/nouveau/nvkm/engine/disp/uconn.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/uconn.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/uconn.c
index 2dab6612c4fc..6a67d307bf79 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/uconn.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/uconn.c
@@ -213,13 +213,14 @@ nvkm_uconn_new(const struct nvkm_oclass *oclass, void *argv, u32 argc, struct nv
default:
WARN_ON(1);
ret = -EINVAL;
- break;
+ goto err;
}
nvkm_object_ctor(&nvkm_uconn, oclass, &conn->object);
*pobject = &conn->object;
ret = 0;
}
+err:
spin_unlock(&disp->client.lock);
return ret;
}
--
2.30.2
reply other threads:[~2024-04-17 8:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240417083920.2256027-1-suhui@nfschina.com \
--to=suhui@nfschina.com \
--cc=airlied@gmail.com \
--cc=airlied@redhat.com \
--cc=bskeggs@redhat.com \
--cc=dakr@redhat.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=justinstitt@google.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kherbst@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=lyude@redhat.com \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=nouveau@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).