diff options
-rw-r--r-- | drivers/net/ipa/ipa_power.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ipa/ipa_power.c b/drivers/net/ipa/ipa_power.c index 16ece27d14d7..db5ac7552286 100644 --- a/drivers/net/ipa/ipa_power.c +++ b/drivers/net/ipa/ipa_power.c @@ -374,8 +374,8 @@ ipa_power_init(struct device *dev, const struct ipa_power_data *data) goto err_clk_put; } - size = data->interconnect_count * sizeof(power->interconnect[0]); - power = kzalloc(sizeof(*power) + size, GFP_KERNEL); + size = struct_size(power, interconnect, data->interconnect_count); + power = kzalloc(size, GFP_KERNEL); if (!power) { ret = -ENOMEM; goto err_clk_put; |