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, { struct i2c_mux_core *muxc; - muxc = devm_kzalloc(dev, sizeof(*muxc) - + max_adapters * sizeof(muxc->adapter[0]) + muxc = devm_kzalloc(dev, struct_size(muxc, adapter, max_adapters) + sizeof_priv, GFP_KERNEL); if (!muxc) return NULL;