stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] Fix uninitialiazed variable bug
@ 2022-01-08 16:37 Ercan Ersoy
  2022-01-08 16:52 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Ercan Ersoy @ 2022-01-08 16:37 UTC (permalink / raw)
  To: security; +Cc: stable


This bug is in mem_cgroup_resize_max function
in mm/memcontrol.c source file.

Signed-off-by: Ercan Ersoy <ercanersoy@ercanersoy.net>
---
  mm/memcontrol.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 2ed5f2a0879d..977f58b8f1e6 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3351,7 +3351,7 @@ static int mem_cgroup_resize_max(struct mem_cgroup 
*memcg,
  {
         bool enlarge = false;
         bool drained = false;
-       int ret;
+       int ret = 0;
         bool limits_invariant;
         struct page_counter *counter = memsw ? &memcg->memsw : 
&memcg->memory;

-- 
2.30.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] Fix uninitialiazed variable bug
  2022-01-08 16:37 [PATCH 1/1] Fix uninitialiazed variable bug Ercan Ersoy
@ 2022-01-08 16:52 ` Greg KH
  2022-01-08 19:05   ` Linus Torvalds
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2022-01-08 16:52 UTC (permalink / raw)
  To: Ercan Ersoy; +Cc: security, stable

On Sat, Jan 08, 2022 at 07:37:59PM +0300, Ercan Ersoy wrote:
> 
> This bug is in mem_cgroup_resize_max function
> in mm/memcontrol.c source file.
> 
> Signed-off-by: Ercan Ersoy <ercanersoy@ercanersoy.net>


<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

</formletter>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] Fix uninitialiazed variable bug
  2022-01-08 16:52 ` Greg KH
@ 2022-01-08 19:05   ` Linus Torvalds
  0 siblings, 0 replies; 3+ messages in thread
From: Linus Torvalds @ 2022-01-08 19:05 UTC (permalink / raw)
  To: Greg KH; +Cc: Ercan Ersoy, Security Officers, stable

On Sat, Jan 8, 2022 at 8:52 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Sat, Jan 08, 2022 at 07:37:59PM +0300, Ercan Ersoy wrote:
> >
> > This bug is in mem_cgroup_resize_max function
> > in mm/memcontrol.c source file.
> >
> > Signed-off-by: Ercan Ersoy <ercanersoy@ercanersoy.net>
>
>
> <formletter>
>
> This is not the correct way to submit patches for inclusion in the
> stable kernel tree.

Even more relevantly, I think the patch is bogus.

What broken tool claims that 'ret' is uninitialized?

That mem_cgroup_resize_max() uses an endless loop construct
(admittedly an odd one - "do while (true)" is not the usual "for (;;)"
syntax). And every single 'break' out of that loop sets the 'ret'
variable.

Whatever tool reported this is just broken, or I'm blind.

                    Linus

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-08 19:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-08 16:37 [PATCH 1/1] Fix uninitialiazed variable bug Ercan Ersoy
2022-01-08 16:52 ` Greg KH
2022-01-08 19:05   ` Linus Torvalds

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 NNTP newsgroup(s).