Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 1 | From 416cee8707053a9015dfec8332e12f8c263098e3 Mon Sep 17 00:00:00 2001 |
| 2 | From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
| 3 | Date: Thu, 14 Feb 2019 11:40:50 -0500 |
| 4 | Subject: [PATCH 9/9] Cleanup: tp mempool: Remove logically dead code |
| 5 | |
| 6 | Found by Coverity: |
| 7 | CID 1391045 (#1 of 1): Logically dead code (DEADCODE) |
| 8 | |
| 9 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
| 10 | |
| 11 | Upstream-Status: backport https://github.com/lttng/lttng-modules/commit/416cee8707053a9015dfec8332e12f8c263098e3 |
| 12 | |
| 13 | Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> |
| 14 | --- |
| 15 | lttng-tp-mempool.c | 11 ++--------- |
| 16 | 1 file changed, 2 insertions(+), 9 deletions(-) |
| 17 | |
| 18 | diff --git a/lttng-tp-mempool.c b/lttng-tp-mempool.c |
| 19 | index d984bd4..21e8376 100644 |
| 20 | --- a/lttng-tp-mempool.c |
| 21 | +++ b/lttng-tp-mempool.c |
| 22 | @@ -151,19 +151,12 @@ void lttng_tp_mempool_free(void *ptr) |
| 23 | struct lttng_tp_buf_entry *entry; |
| 24 | struct per_cpu_buf *cpu_buf; |
| 25 | |
| 26 | - if (!ptr) { |
| 27 | + if (!ptr) |
| 28 | goto end; |
| 29 | - } |
| 30 | - |
| 31 | entry = container_of(ptr, struct lttng_tp_buf_entry, buf); |
| 32 | - if (!entry) { |
| 33 | - goto end; |
| 34 | - } |
| 35 | - |
| 36 | cpu_buf = per_cpu_ptr(pool, entry->cpu); |
| 37 | - if (!cpu_buf) { |
| 38 | + if (!cpu_buf) |
| 39 | goto end; |
| 40 | - } |
| 41 | /* Add it to the free list. */ |
| 42 | list_add_tail(&entry->list, &cpu_buf->free_list); |
| 43 | |
| 44 | -- |
| 45 | 2.19.1 |
| 46 | |