From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751821AbdHBVPA (ORCPT ); Wed, 2 Aug 2017 17:15:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:39360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751704AbdHBVO5 (ORCPT ); Wed, 2 Aug 2017 17:14:57 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 58A592392C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=mcgrof@kernel.org From: "Luis R. Rodriguez" To: akpm@linux-foundation.org Cc: dmitry.torokhov@gmail.com, keescook@chromium.org, jeyu@redhat.com, rusty@rustcorp.com.au, mmarek@suse.com, pmladek@suse.com, mbenes@suse.cz, jpoimboe@redhat.com, ebiederm@xmission.com, shuah@kernel.org, dan.carpenter@oracle.com, colin.king@canonical.com, dcb314@hotmail.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, "Luis R . Rodriguez" Subject: [PATCH 5/5] test_kmod: fix small memory leak on filesystem tests Date: Wed, 2 Aug 2017 14:14:50 -0700 Message-Id: <20170802211450.27928-6-mcgrof@kernel.org> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20170802211450.27928-1-mcgrof@kernel.org> References: <20170802211450.27928-1-mcgrof@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter The break was in the wrong place so file system tests don't work as intended, leaking memory at each test switch. Fixes: 39258f448d71 ("kmod: add test driver to stress test the module loader") Signed-off-by: Dan Carpenter Reported-by: David Binderman [mcgrof: massaged commit subject, noted memory leak issue without the fix] Signed-off-by: Luis R. Rodriguez --- lib/test_kmod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/test_kmod.c b/lib/test_kmod.c index 1bc06bbfc97a..ff9148969b92 100644 --- a/lib/test_kmod.c +++ b/lib/test_kmod.c @@ -746,11 +746,11 @@ static int trigger_config_run_type(struct kmod_test_device *test_dev, strlen(test_str)); break; case TEST_KMOD_FS_TYPE: - break; kfree_const(config->test_fs); config->test_driver = NULL; copied = config_copy_test_fs(config, test_str, strlen(test_str)); + break; default: mutex_unlock(&test_dev->config_mutex); return -EINVAL; -- 2.11.0