Message ID | d89cc03128a6e449ce49f729b9eeafe687356b4e.1621517561.git.grive@u256.net |
---|---|
State | Accepted |
Headers | show |
Series | RCU: Add blocking mode for debugging | expand |
On Thu, May 20, 2021 at 03:35:51PM +0200, Gaetan Rivet wrote: > A mutex is allocated, initialized and destroyed, without being > used in the perthread structure. > > Signed-off-by: Gaetan Rivet <grive@u256.net> This got independently reported by 贺鹏 <xnhp0320@gmail.com>. Acked-by: Ben Pfaff <blp@ovn.org>
On 7/2/21 7:41 PM, Ben Pfaff wrote: > On Thu, May 20, 2021 at 03:35:51PM +0200, Gaetan Rivet wrote: >> A mutex is allocated, initialized and destroyed, without being >> used in the perthread structure. >> >> Signed-off-by: Gaetan Rivet <grive@u256.net> > > This got independently reported by 贺鹏 <xnhp0320@gmail.com>. > > Acked-by: Ben Pfaff <blp@ovn.org> Thanks, Gaetan and Ben! This patch is independent from the rest of the series, so I applied it to master. Best regards, Ilya Maximets.
diff --git a/lib/ovs-rcu.c b/lib/ovs-rcu.c index cde1e925b..1866bd308 100644 --- a/lib/ovs-rcu.c +++ b/lib/ovs-rcu.c @@ -47,7 +47,6 @@ struct ovsrcu_cbset { struct ovsrcu_perthread { struct ovs_list list_node; /* In global list. */ - struct ovs_mutex mutex; uint64_t seqno; struct ovsrcu_cbset *cbset; char name[16]; /* This thread's name. */ @@ -84,7 +83,6 @@ ovsrcu_perthread_get(void) const char *name = get_subprogram_name(); perthread = xmalloc(sizeof *perthread); - ovs_mutex_init(&perthread->mutex); perthread->seqno = seq_read(global_seqno); perthread->cbset = NULL; ovs_strlcpy(perthread->name, name[0] ? name : "main", @@ -406,7 +404,6 @@ ovsrcu_unregister__(struct ovsrcu_perthread *perthread) ovs_list_remove(&perthread->list_node); ovs_mutex_unlock(&ovsrcu_threads_mutex); - ovs_mutex_destroy(&perthread->mutex); free(perthread); seq_change(global_seqno);
A mutex is allocated, initialized and destroyed, without being used in the perthread structure. Signed-off-by: Gaetan Rivet <grive@u256.net> --- lib/ovs-rcu.c | 3 --- 1 file changed, 3 deletions(-)