[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZW4dePVEM8sslNAJ@ghost>
Date: Mon, 4 Dec 2023 10:42:00 -0800
From: Charlie Jenkins <charlie@...osinc.com>
To: Andreas Schwab <schwab@...ux-m68k.org>
Cc: Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>, Ron Economos <re@...z.net>,
Samuel Holland <samuel.holland@...ive.com>,
linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/2] riscv: Safely remove entries from relocation list
On Mon, Nov 27, 2023 at 11:42:08AM +0100, Andreas Schwab wrote:
> On Nov 22 2023, Charlie Jenkins wrote:
>
> > @@ -683,17 +700,29 @@ int add_relocation_to_accumulate(struct module *me, int type, void *location,
> >
> > if (!found) {
> > rel_head = kmalloc(sizeof(*rel_head), GFP_KERNEL);
> > +
> > + if (!rel_head)
> > + return -ENOMEM;
> > +
> > rel_head->rel_entry =
> > kmalloc(sizeof(struct list_head), GFP_KERNEL);
> > +
> > + if (!rel_head->rel_entry)
> > + return -ENOMEM;
>
> This leaks rel_head on error.
>
> --
> Andreas Schwab, schwab@...ux-m68k.org
> GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
> "And now for something completely different."
Thank you for pointing this out, I fixed this issue in the next version
but forgot to respond to this thread.
https://lore.kernel.org/linux-riscv/20231127-module_linking_freeing-v4-1-a2ca1d7027d0@rivosinc.com/
- Charlie
Powered by blists - more mailing lists