summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/irqchip/qcom-irq-combiner.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/irqchip/qcom-irq-combiner.c b/drivers/irqchip/qcom-irq-combiner.c
index 7f0c0be322e0..d269a7722032 100644
--- a/drivers/irqchip/qcom-irq-combiner.c
+++ b/drivers/irqchip/qcom-irq-combiner.c
@@ -237,7 +237,6 @@ static int get_registers(struct platform_device *pdev, struct combiner *comb)
237static int __init combiner_probe(struct platform_device *pdev) 237static int __init combiner_probe(struct platform_device *pdev)
238{ 238{
239 struct combiner *combiner; 239 struct combiner *combiner;
240 size_t alloc_sz;
241 int nregs; 240 int nregs;
242 int err; 241 int err;
243 242
@@ -247,8 +246,8 @@ static int __init combiner_probe(struct platform_device *pdev)
247 return -EINVAL; 246 return -EINVAL;
248 } 247 }
249 248
250 alloc_sz = sizeof(*combiner) + sizeof(struct combiner_reg) * nregs; 249 combiner = devm_kzalloc(&pdev->dev, struct_size(combiner, regs, nregs),
251 combiner = devm_kzalloc(&pdev->dev, alloc_sz, GFP_KERNEL); 250 GFP_KERNEL);
252 if (!combiner) 251 if (!combiner)
253 return -ENOMEM; 252 return -ENOMEM;
254 253