hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/virt/kvm/irqchip.c
....@@ -1,21 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * irqchip.c: Common API for in kernel interrupt controllers
34 * Copyright (c) 2007, Intel Corporation.
45 * Copyright 2010 Red Hat, Inc. and/or its affiliates.
56 * Copyright (c) 2013, Alexander Graf <agraf@suse.de>
6
- *
7
- * This program is free software; you can redistribute it and/or modify it
8
- * under the terms and conditions of the GNU General Public License,
9
- * version 2, as published by the Free Software Foundation.
10
- *
11
- * This program is distributed in the hope it will be useful, but WITHOUT
12
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14
- * more details.
15
- *
16
- * You should have received a copy of the GNU General Public License along with
17
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
18
- * Place - Suite 330, Boston, MA 02111-1307 USA.
197 *
208 * This file is derived from virt/kvm/irq_comm.c.
219 *
....@@ -196,9 +184,7 @@
196184
197185 nr_rt_entries += 1;
198186
199
- new = kzalloc(sizeof(*new) + (nr_rt_entries * sizeof(struct hlist_head)),
200
- GFP_KERNEL);
201
-
187
+ new = kzalloc(struct_size(new, map, nr_rt_entries), GFP_KERNEL_ACCOUNT);
202188 if (!new)
203189 return -ENOMEM;
204190
....@@ -209,7 +195,7 @@
209195
210196 for (i = 0; i < nr; ++i) {
211197 r = -ENOMEM;
212
- e = kzalloc(sizeof(*e), GFP_KERNEL);
198
+ e = kzalloc(sizeof(*e), GFP_KERNEL_ACCOUNT);
213199 if (!e)
214200 goto out;
215201