diff mbox series

[GIT,PULL] KUnit fixes update for Linux 6.2-rc2

Message ID 226f1d09-aed1-e1c7-1607-e71393cd3a51@linuxfoundation.org (mailing list archive)
State Accepted
Commit 69fb073b5ba6d7c9358a04115ed61b78c73790ce
Delegated to: Brendan Higgins
Headers show
Series [GIT,PULL] KUnit fixes update for Linux 6.2-rc2 | expand

Pull-request

git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux-kselftest-kunit-fixes-6.2-rc2

Commit Message

Shuah Khan Dec. 29, 2022, 11:07 p.m. UTC
Hi Linus,

Please pull the following KUnit fixes update for Linux 6.2-rc2.

This KUnit update for Linux 6.2-rc2 consists of:

- alloc_string_stream_fragment() error path fix to free before
   returning a failure.

diff is attached.

thanks,
-- Shuah

----------------------------------------------------------------
The following changes since commit 1b929c02afd37871d5afb9d498426f83432e71c2:

   Linux 6.2-rc1 (2022-12-25 13:41:39 -0800)

are available in the Git repository at:

   git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux-kselftest-kunit-fixes-6.2-rc2

for you to fetch changes up to 93ef83050e597634d2c7dc838a28caf5137b9404:

   kunit: alloc_string_stream_fragment error handling bug fix (2022-12-26 16:01:36 -0700)

----------------------------------------------------------------
linux-kselftest-kunit-fixes-6.2-rc2

This KUnit update for Linux 6.2-rc2 consists of:

- alloc_string_stream_fragment() error path fix to free before
   returning a failure.

----------------------------------------------------------------
YoungJun.park (1):
       kunit: alloc_string_stream_fragment error handling bug fix

  lib/kunit/string-stream.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------

Comments

pr-tracker-bot@kernel.org Dec. 30, 2022, 1:01 a.m. UTC | #1
The pull request you sent on Thu, 29 Dec 2022 16:07:21 -0700:

> git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux-kselftest-kunit-fixes-6.2-rc2

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/69fb073b5ba6d7c9358a04115ed61b78c73790ce

Thank you!
diff mbox series

Patch

diff --git a/lib/kunit/string-stream.c b/lib/kunit/string-stream.c
index f5f51166d8c2..cc32743c1171 100644
--- a/lib/kunit/string-stream.c
+++ b/lib/kunit/string-stream.c
@@ -23,8 +23,10 @@  static struct string_stream_fragment *alloc_string_stream_fragment(
 		return ERR_PTR(-ENOMEM);
 
 	frag->fragment = kunit_kmalloc(test, len, gfp);
-	if (!frag->fragment)
+	if (!frag->fragment) {
+		kunit_kfree(test, frag);
 		return ERR_PTR(-ENOMEM);
+	}
 
 	return frag;
 }