Message ID | 53066ac3-523a-4db9-a636-9c99ef56c7c1@moroto.mountain (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | rtla: Uninitialized variable in find_mount() | expand |
On 7/31/23 16:11, Dan Carpenter wrote: > The "found" variable needs to be set to 0/false at the start. > > Fixes: a957cbc02531 ("rtla: Add -C cgroup support") > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> > --- > tools/tracing/rtla/src/utils.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/tracing/rtla/src/utils.c b/tools/tracing/rtla/src/utils.c > index 623a38908ed5..c769d7b3842c 100644 > --- a/tools/tracing/rtla/src/utils.c > +++ b/tools/tracing/rtla/src/utils.c > @@ -538,7 +538,7 @@ static const int find_mount(const char *fs, char *mp, int sizeof_mp) > { > char mount_point[MAX_PATH]; > char type[100]; > - int found; > + int found = 0; > FILE *fp; Same problem, right? https://lore.kernel.org/lkml/20230727150117.627730-1-colin.i.king@gmail.com/ -- Daniel > > fp = fopen("/proc/mounts", "r");
diff --git a/tools/tracing/rtla/src/utils.c b/tools/tracing/rtla/src/utils.c index 623a38908ed5..c769d7b3842c 100644 --- a/tools/tracing/rtla/src/utils.c +++ b/tools/tracing/rtla/src/utils.c @@ -538,7 +538,7 @@ static const int find_mount(const char *fs, char *mp, int sizeof_mp) { char mount_point[MAX_PATH]; char type[100]; - int found; + int found = 0; FILE *fp; fp = fopen("/proc/mounts", "r");
The "found" variable needs to be set to 0/false at the start. Fixes: a957cbc02531 ("rtla: Add -C cgroup support") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> --- tools/tracing/rtla/src/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)