Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp877381pxb; Thu, 5 Nov 2020 15:49:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJyqGhjhmpKUR1unYaDUIVoEByhVqV6hHWVd2yVcGtfIHZ0yhuvhnFYoyaPgwZRIQ6tcCRNW X-Received: by 2002:a17:906:892:: with SMTP id n18mr4805849eje.1.1604620184653; Thu, 05 Nov 2020 15:49:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604620184; cv=none; d=google.com; s=arc-20160816; b=Z9wAPdXHXSvD5tb8svNMPpuhgndux2dlPlwo+AMoJummfTiTp4aZfC2cmSNpVZICB9 c3Kl1RQlrHNYSuPPXxt1gASkdxqO97zUU4/lGdEceaiHODbYYRLhLFOyzMcv4p8Rf5xJ Tb3shsrYgfTKskhFtMagWgJ0/tN1JKX7xpK6uub5xCITnPrirIwRGsEDc2aDMVpfLl2Y /nynZLTtO+kMokuAkS2nxptAASNR6EGL1R/SKrls0fipFBDyYdNw3FGhD1UYdFvsO26x joWOhf37vtdlrsUTzlUa+l4shgVWCZ6NUY6z6WL5NtBQshp7hTxGQIQ0qBP2E6Ov6SQb /u5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=y0nCijObKoElLrIJq6xjHS30xNhJuaa4lG1NQgiQxjE=; b=jfqBmx4Il+XsyW95fkfg7A7mQ+Lppsz4OW6m/vTpL+4yZ/fek22nCKwox7hquBiB0o 6qH9L194yId994DtCNzoDMAvB02SGwyqzKEdKr/cyXHv0rElYKaTA9ClqB7EtJMr3jFL kUCUsXX2g5ImyFtCaT0ahgUNLYR9f4uUEs1QUqtPlvUyt/o2AKOJx4038ZGHjK8FMKjy xtOAU3uvBUEQ5eW2Yb4/TJwukt9hYEE2sgJHaAPJwqw0fWZyoC1uhGQJA91JifOx2meB qz+4FulILKwIPUvHEYJzj5PHMvFbO200kUr3yYG+/SmtoZ4XX6e4YwMpiY25QSYr6TOk SLNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OUxFotAv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t5si2319820edj.574.2020.11.05.15.49.22; Thu, 05 Nov 2020 15:49:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OUxFotAv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732931AbgKEXrp (ORCPT + 99 others); Thu, 5 Nov 2020 18:47:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:45930 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732766AbgKEXr3 (ORCPT ); Thu, 5 Nov 2020 18:47:29 -0500 Received: from paulmck-ThinkPad-P72.home (50-39-104-11.bvtn.or.frontiernet.net [50.39.104.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E04D02073A; Thu, 5 Nov 2020 23:47:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604620049; bh=1/H3wW3U3WqFpcLj5GDy0TXJzyUIxyTZnrzzVXzfM9k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OUxFotAvs2Ht9ig3LqV5l/mbBTN5umCd5ip1+1bzkAx1f4DP1QyYlYJfojOIcQrCl uef5mXUZko4TJKXocQLcLWIT8wJgjfTo5Q9TbcFp3qX6MOau2BeaGjiAp+WUm+AckK uRUiuiwtTZPPVXsG9t2TRRuOYr6Avn6Vd/cgKLNg= From: paulmck@kernel.org To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, mingo@kernel.org, jiangshanlai@gmail.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org, "Paul E. McKenney" Subject: [PATCH tip/core/rcu 20/28] rcutorture: Small code cleanups Date: Thu, 5 Nov 2020 15:47:11 -0800 Message-Id: <20201105234719.23307-20-paulmck@kernel.org> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20201105234658.GA23142@paulmck-ThinkPad-P72> References: <20201105234658.GA23142@paulmck-ThinkPad-P72> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Paul E. McKenney" The rcu_torture_cleanup() function fails to NULL out the reader_tasks pointer after freeing it and its fakewriter_tasks loop has redundant braces. This commit therefore cleans these up. Signed-off-by: Paul E. McKenney --- kernel/rcu/rcutorture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 4391d2f..e7d52fd 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -2496,13 +2496,13 @@ rcu_torture_cleanup(void) torture_stop_kthread(rcu_torture_reader, reader_tasks[i]); kfree(reader_tasks); + reader_tasks = NULL; } if (fakewriter_tasks) { - for (i = 0; i < nfakewriters; i++) { + for (i = 0; i < nfakewriters; i++) torture_stop_kthread(rcu_torture_fakewriter, fakewriter_tasks[i]); - } kfree(fakewriter_tasks); fakewriter_tasks = NULL; } -- 2.9.5