diff options
-rw-r--r-- | drivers/i2c/i2c-mux.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c index 603252fa1284..8d5e4c6fdd8e 100644 --- a/drivers/i2c/i2c-mux.c +++ b/drivers/i2c/i2c-mux.c | |||
@@ -243,8 +243,7 @@ struct i2c_mux_core *i2c_mux_alloc(struct i2c_adapter *parent, | |||
243 | { | 243 | { |
244 | struct i2c_mux_core *muxc; | 244 | struct i2c_mux_core *muxc; |
245 | 245 | ||
246 | muxc = devm_kzalloc(dev, sizeof(*muxc) | 246 | muxc = devm_kzalloc(dev, struct_size(muxc, adapter, max_adapters) |
247 | + max_adapters * sizeof(muxc->adapter[0]) | ||
248 | + sizeof_priv, GFP_KERNEL); | 247 | + sizeof_priv, GFP_KERNEL); |
249 | if (!muxc) | 248 | if (!muxc) |
250 | return NULL; | 249 | return NULL; |