* [PATCH] ceph: Silence a checker warning on the error path
@ 2019-05-09 10:11 Dan Carpenter
2019-05-09 14:34 ` Ilya Dryomov
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2019-05-09 10:11 UTC (permalink / raw)
To: kernel-janitors
The problem is that if ceph_mdsc_build_path() fails then we set "path"
to NULL and the "pathlen" variable is uninitialized. The we call
ceph_mdsc_free_path(path, pathlen) to clean up. Since "path" is NULL,
the function is a no-op but Smatch and UBSan still complain that
"pathlen" is uninitialized.
This patch doesn't change run time, it just silence the warnings.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
fs/ceph/debugfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ceph/debugfs.c b/fs/ceph/debugfs.c
index b3fc5fe26a1a..a14d64664878 100644
--- a/fs/ceph/debugfs.c
+++ b/fs/ceph/debugfs.c
@@ -52,7 +52,7 @@ static int mdsc_show(struct seq_file *s, void *p)
struct ceph_mds_client *mdsc = fsc->mdsc;
struct ceph_mds_request *req;
struct rb_node *rp;
- int pathlen;
+ int pathlen = 0;
u64 pathbase;
char *path;
--
2.18.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ceph: Silence a checker warning on the error path
2019-05-09 10:11 [PATCH] ceph: Silence a checker warning on the error path Dan Carpenter
@ 2019-05-09 14:34 ` Ilya Dryomov
0 siblings, 0 replies; 2+ messages in thread
From: Ilya Dryomov @ 2019-05-09 14:34 UTC (permalink / raw)
To: kernel-janitors
On Thu, May 9, 2019 at 12:11 PM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> The problem is that if ceph_mdsc_build_path() fails then we set "path"
> to NULL and the "pathlen" variable is uninitialized. The we call
> ceph_mdsc_free_path(path, pathlen) to clean up. Since "path" is NULL,
> the function is a no-op but Smatch and UBSan still complain that
> "pathlen" is uninitialized.
>
> This patch doesn't change run time, it just silence the warnings.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> fs/ceph/debugfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ceph/debugfs.c b/fs/ceph/debugfs.c
> index b3fc5fe26a1a..a14d64664878 100644
> --- a/fs/ceph/debugfs.c
> +++ b/fs/ceph/debugfs.c
> @@ -52,7 +52,7 @@ static int mdsc_show(struct seq_file *s, void *p)
> struct ceph_mds_client *mdsc = fsc->mdsc;
> struct ceph_mds_request *req;
> struct rb_node *rp;
> - int pathlen;
> + int pathlen = 0;
> u64 pathbase;
> char *path;
>
Applied.
Thanks,
Ilya
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-05-09 14:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-09 10:11 [PATCH] ceph: Silence a checker warning on the error path Dan Carpenter
2019-05-09 14:34 ` Ilya Dryomov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.