diff options
-rw-r--r-- | drivers/char/hpet.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c index 9bffcd37cc7b..d0ad85900b79 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c @@ -842,7 +842,6 @@ int hpet_alloc(struct hpet_data *hdp) struct hpet_dev *devp; u32 i, ntimer; struct hpets *hpetp; - size_t siz; struct hpet __iomem *hpet; static struct hpets *last; unsigned long period; @@ -860,10 +859,8 @@ int hpet_alloc(struct hpet_data *hdp) return 0; } - siz = sizeof(struct hpets) + ((hdp->hd_nirqs - 1) * - sizeof(struct hpet_dev)); - - hpetp = kzalloc(siz, GFP_KERNEL); + hpetp = kzalloc(struct_size(hpetp, hp_dev, hdp->hd_nirqs - 1), + GFP_KERNEL); if (!hpetp) return -ENOMEM; |