Commit 69fb073b authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'linux-kselftest-kunit-fixes-6.2-rc2' of...

Merge tag 'linux-kselftest-kunit-fixes-6.2-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull KUnit fix from Shuah Khan:

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

* tag 'linux-kselftest-kunit-fixes-6.2-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  kunit: alloc_string_stream_fragment error handling bug fix
parents 2258c2dc 93ef8305
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;
}