Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[sfrench/cifs-2.6.git] / drivers / input / rmi4 / rmi_f12.c
index e226def74d8280d88ce8eca0e3d4f4cbeaf47abb..5c7f489157792bf32da34e982b715824ec17eaff 100644 (file)
@@ -502,14 +502,15 @@ static int rmi_f12_probe(struct rmi_function *fn)
        }
 
        /* allocate the in-kernel tracking buffers */
-       sensor->tracking_pos = devm_kzalloc(&fn->dev,
-                       sizeof(struct input_mt_pos) * sensor->nbr_fingers,
+       sensor->tracking_pos = devm_kcalloc(&fn->dev,
+                       sensor->nbr_fingers, sizeof(struct input_mt_pos),
+                       GFP_KERNEL);
+       sensor->tracking_slots = devm_kcalloc(&fn->dev,
+                       sensor->nbr_fingers, sizeof(int), GFP_KERNEL);
+       sensor->objs = devm_kcalloc(&fn->dev,
+                       sensor->nbr_fingers,
+                       sizeof(struct rmi_2d_sensor_abs_object),
                        GFP_KERNEL);
-       sensor->tracking_slots = devm_kzalloc(&fn->dev,
-                       sizeof(int) * sensor->nbr_fingers, GFP_KERNEL);
-       sensor->objs = devm_kzalloc(&fn->dev,
-                       sizeof(struct rmi_2d_sensor_abs_object)
-                       * sensor->nbr_fingers, GFP_KERNEL);
        if (!sensor->tracking_pos || !sensor->tracking_slots || !sensor->objs)
                return -ENOMEM;