]> Git Repo - linux.git/commitdiff
ACPI, APEI: Use the correct variable for sizeof()
authorJakob Koschel <[email protected]>
Sat, 19 Mar 2022 21:54:47 +0000 (22:54 +0100)
committerRafael J. Wysocki <[email protected]>
Tue, 22 Mar 2022 17:52:21 +0000 (18:52 +0100)
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 <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
drivers/acpi/apei/apei-base.c

index c7fdb12c33105adf0b33481b84493ac078d9eddd..33b7fbbeda82ee60f9f573d3f825f637b07802d2 100644 (file)
@@ -319,7 +319,7 @@ repeat:
        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;
This page took 0.058606 seconds and 4 git commands to generate.