Message ID | 8a50aeac-0c9e-fff9-a7e7-61bcd733dfce@users.sourceforge.net (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c index 4ef73374a8f9..349494fc8def 100644 --- a/drivers/hid/hid-sensor-hub.c +++ b/drivers/hid/hid-sensor-hub.c @@ -672,9 +672,11 @@ static int sensor_hub_probe(struct hid_device *hdev, ret = -EINVAL; goto err_stop_hw; } - sd->hid_sensor_hub_client_devs = devm_kzalloc(&hdev->dev, dev_cnt * - sizeof(struct mfd_cell), - GFP_KERNEL); + sd->hid_sensor_hub_client_devs + = devm_kcalloc(&hdev->dev, + dev_cnt, + sizeof(*sd->hid_sensor_hub_client_devs), + GFP_KERNEL); if (sd->hid_sensor_hub_client_devs == NULL) { hid_err(hdev, "Failed to allocate memory for mfd cells\n"); ret = -ENOMEM;