Skip to content

Commit fa34165

Browse files
Jakob-Koschelrafaeljw
authored andcommitted
ACPI, APEI: Use the correct variable for sizeof()
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@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 242ba66 commit fa34165

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/acpi/apei/apei-base.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ static int apei_res_add(struct list_head *res_list,
319319
if (res_ins)
320320
list_add(&res_ins->list, res_list);
321321
else {
322-
res_ins = kmalloc(sizeof(*res), GFP_KERNEL);
322+
res_ins = kmalloc(sizeof(*res_ins), GFP_KERNEL);
323323
if (!res_ins)
324324
return -ENOMEM;
325325
res_ins->start = start;

0 commit comments

Comments
 (0)