summaryrefslogtreecommitdiffstats
path: root/drivers/misc/cb710/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/cb710/core.c')
-rw-r--r--drivers/misc/cb710/core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/misc/cb710/core.c b/drivers/misc/cb710/core.c
index fb397e7d1cce..4d4acf763b65 100644
--- a/drivers/misc/cb710/core.c
+++ b/drivers/misc/cb710/core.c
@@ -232,8 +232,8 @@ static int cb710_probe(struct pci_dev *pdev,
if (val & CB710_SLOT_SM)
++n;
- chip = devm_kzalloc(&pdev->dev,
- sizeof(*chip) + n * sizeof(*chip->slot), GFP_KERNEL);
+ chip = devm_kzalloc(&pdev->dev, struct_size(chip, slot, n),
+ GFP_KERNEL);
if (!chip)
return -ENOMEM;