From: Edward Liaw <edliaw@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: kernel test robot <yujie.liu@intel.com>,
oe-kbuild-all@lists.linux.dev,
Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [linux-next:master 5507/6266] ../kselftest_harness.h:1167:9: warning: ignoring return value of 'asprintf' declared with attribute 'warn_unused_result'
Date: Tue, 16 Apr 2024 12:02:18 -0700 [thread overview]
Message-ID: <CAG4es9VxQSH=fUVSz0Op--sJhQbCJ_fLYyZB-tYuoCeYEoyxMA@mail.gmail.com> (raw)
In-Reply-To: <20240416114439.038054b9c33986a13f4757c7@linux-foundation.org>
On Tue, Apr 16, 2024 at 11:44 AM Andrew Morton
<akpm@linux-foundation.org> wrote:
>
> Thanks. How does this look?
>
> --- a/tools/testing/selftests/kselftest_harness.h~selftests-harness-remove-use-of-line_max-fix-fix
> +++ a/tools/testing/selftests/kselftest_harness.h
> @@ -1163,8 +1163,12 @@ void __run_test(struct __fixture_metadat
> t->trigger = 0;
> memset(t->results->reason, 0, sizeof(t->results->reason));
>
> - asprintf(&test_name, "%s%s%s.%s", f->name,
> - variant->name[0] ? "." : "", variant->name, t->name);
> + if (asprintf(&test_name, "%s%s%s.%s", f->name,
> + variant->name[0] ? "." : "", variant->name, t->name) == -1) {
> + ksft_print_msg("ERROR ALLOCATING MEMORY\n");
> + t->exit_code = KSFT_FAIL;
> + _exit(t->exit_code);
> + }
>
> ksft_print_msg(" RUN %s ...\n", test_name);
>
> _
>
Thanks for fixing this, that looks good to me.
Reviewed-by: Edward Liaw <edliaw@google.com>
next prev parent reply other threads:[~2024-04-16 19:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-16 6:35 kernel test robot
2024-04-16 18:44 ` Andrew Morton
2024-04-16 19:02 ` Edward Liaw [this message]
2024-04-17 2:42 ` Yujie Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAG4es9VxQSH=fUVSz0Op--sJhQbCJ_fLYyZB-tYuoCeYEoyxMA@mail.gmail.com' \
--to=edliaw@google.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=yujie.liu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox