summaryrefslogtreecommitdiff
path: root/drivers/net/can/peak_canfd/peak_pciefd_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/can/peak_canfd/peak_pciefd_main.c')
-rw-r--r--drivers/net/can/peak_canfd/peak_pciefd_main.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/can/peak_canfd/peak_pciefd_main.c b/drivers/net/can/peak_canfd/peak_pciefd_main.c
index 3c51a884db87..b9e28578bc7b 100644
--- a/drivers/net/can/peak_canfd/peak_pciefd_main.c
+++ b/drivers/net/can/peak_canfd/peak_pciefd_main.c
@@ -752,8 +752,7 @@ static int peak_pciefd_probe(struct pci_dev *pdev,
can_count = 1;
/* allocate board structure object */
- pciefd = devm_kzalloc(&pdev->dev, sizeof(*pciefd) +
- can_count * sizeof(*pciefd->can),
+ pciefd = devm_kzalloc(&pdev->dev, struct_size(pciefd, can, can_count),
GFP_KERNEL);
if (!pciefd) {
err = -ENOMEM;