Impact: clean up kcalloc is a better approach to allocate a NULL array.
Unified · Split
| @@ -3328,7 +3328,7 @@ create_trace_option_files(struct tracer *tracer) · 3327 unmodified lines | |||
| 3328 | for (cnt = 0; opts[cnt].name; cnt++) | 3328 | for (cnt = 0; opts[cnt].name; cnt++) |
| 3329 | ; | 3329 | ; |
| 3330 | 3330 | ||
| 3331 | topts = kzalloc(sizeof(*topts) * (cnt + 1), GFP_KERNEL); | 3331 | topts = kcalloc(cnt + 1, sizeof(*topts), GFP_KERNEL); |
| 3332 | if (!topts) | 3332 | if (!topts) |
| 3333 | return NULL; | 3333 | return NULL; |
| 3334 | 3334 | ||