|
@@ -3559,8 +3559,8 @@ int ib_uverbs_ex_create_flow(struct ib_uverbs_file *file,
|
|
|
goto err_uobj;
|
|
|
}
|
|
|
|
|
|
- flow_attr = kzalloc(sizeof(*flow_attr) + cmd.flow_attr.num_of_specs *
|
|
|
- sizeof(union ib_flow_spec), GFP_KERNEL);
|
|
|
+ flow_attr = kzalloc(struct_size(flow_attr, flows,
|
|
|
+ cmd.flow_attr.num_of_specs), GFP_KERNEL);
|
|
|
if (!flow_attr) {
|
|
|
err = -ENOMEM;
|
|
|
goto err_put;
|