[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJZ5v0iRvaRyWEZqBxgx5juXUc6Oec5tsiiXfFPd_JGBMKVvJQ@mail.gmail.com>
Date: Tue, 22 Mar 2022 18:53:22 +0100
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Jakob Koschel <jakobkoschel@...il.com>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
Len Brown <lenb@...nel.org>, James Morse <james.morse@....com>,
Tony Luck <tony.luck@...el.com>,
Borislav Petkov <bp@...en8.de>,
Mike Rapoport <rppt@...nel.org>,
Brian Johannesmeyer <bjohannesmeyer@...il.com>,
Cristiano Giuffrida <c.giuffrida@...nl>,
"Bos, H.J." <h.j.bos@...nl>
Subject: Re: [PATCH] ACPI, APEI: fix using the correct variable for sizeof()
On Sat, Mar 19, 2022 at 10:55 PM Jakob Koschel <jakobkoschel@...il.com> wrote:
>
> While the original code is valid, it is not the obvious choice for the
> sizeof() call and in preparation to limit the scope of the list iterator
> variable the sizeof should be changed to the size of the variable
> being allocated.
>
> Signed-off-by: Jakob Koschel <jakobkoschel@...il.com>
> ---
> drivers/acpi/apei/apei-base.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/apei/apei-base.c b/drivers/acpi/apei/apei-base.c
> index c7fdb12c3310..33b7fbbeda82 100644
> --- a/drivers/acpi/apei/apei-base.c
> +++ b/drivers/acpi/apei/apei-base.c
> @@ -319,7 +319,7 @@ static int apei_res_add(struct list_head *res_list,
> if (res_ins)
> list_add(&res_ins->list, res_list);
> else {
> - res_ins = kmalloc(sizeof(*res), GFP_KERNEL);
> + res_ins = kmalloc(sizeof(*res_ins), GFP_KERNEL);
> if (!res_ins)
> return -ENOMEM;
> res_ins->start = start;
>
> base-commit: 34e047aa16c0123bbae8e2f6df33e5ecc1f56601
> --
Applied as 5.18-rc material, thanks!
Powered by blists - more mailing lists