diff options
-rw-r--r-- | kernel/trace/trace.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 814ff306ae74..a120f98c4112 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -2390,6 +2390,9 @@ __tracing_open(struct inode *inode, struct file *file) | |||
2390 | 2390 | ||
2391 | iter->buffer_iter = kzalloc(sizeof(*iter->buffer_iter) * num_possible_cpus(), | 2391 | iter->buffer_iter = kzalloc(sizeof(*iter->buffer_iter) * num_possible_cpus(), |
2392 | GFP_KERNEL); | 2392 | GFP_KERNEL); |
2393 | if (!iter->buffer_iter) | ||
2394 | goto release; | ||
2395 | |||
2393 | /* | 2396 | /* |
2394 | * We make a copy of the current tracer to avoid concurrent | 2397 | * We make a copy of the current tracer to avoid concurrent |
2395 | * changes on it while we are reading. | 2398 | * changes on it while we are reading. |
@@ -2451,6 +2454,7 @@ __tracing_open(struct inode *inode, struct file *file) | |||
2451 | mutex_unlock(&trace_types_lock); | 2454 | mutex_unlock(&trace_types_lock); |
2452 | kfree(iter->trace); | 2455 | kfree(iter->trace); |
2453 | kfree(iter->buffer_iter); | 2456 | kfree(iter->buffer_iter); |
2457 | release: | ||
2454 | seq_release_private(inode, file); | 2458 | seq_release_private(inode, file); |
2455 | return ERR_PTR(-ENOMEM); | 2459 | return ERR_PTR(-ENOMEM); |
2456 | } | 2460 | } |