From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Reinette Chatre <reinette.chatre@intel.com>
Cc: linux-kselftest@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
Fenghua Yu <fenghua.yu@intel.com>, Shuah Khan <shuah@kernel.org>,
Babu Moger <babu.moger@amd.com>,
Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
Subject: Re: [PATCH 1/4] selftests/resctrl: Return error if memory is not allocated
Date: Tue, 14 Feb 2023 11:32:38 +0200 (EET) [thread overview]
Message-ID: <a4b44d-23f8-6df1-e494-908fbd43b732@linux.intel.com> (raw)
In-Reply-To: <88a819d7-b236-aed5-7cb8-6659e3f9f405@intel.com>
[-- Attachment #1: Type: text/plain, Size: 1746 bytes --]
On Mon, 13 Feb 2023, Reinette Chatre wrote:
> I do not see a why two patch series are needed for
> the resctrl fixes. It may make it easier for everybody if
> it is handled as one patch series (with fixes first)?
Ok, I can put the fixes and cleanups into one series.
> On 2/8/2023 1:30 AM, Ilpo Järvinen wrote:
> > From: Fenghua Yu <fenghua.yu@intel.com>
> >
> > malloc_and_init_memory() in fill_buf isn't checking if memalign()
> > successfully allocated memory or not before accessing the memory.
> >
> > Check the return value of memalign() and return NULL if allocating
> > aligned memory fails.
> >
> > Fixes: a2561b12fe39 ("selftests/resctrl: Add built in benchmark")
> > Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
>
> Missing your Signed-off-by?
These were intentionally. When I didn't modify the original patch at
all during forward porting it, I just kept the original From and SoB as
is. But from the doc you pointed me to, I see now x86 wants also handlers
sobs.
> > ---
> > tools/testing/selftests/resctrl/fill_buf.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/tools/testing/selftests/resctrl/fill_buf.c b/tools/testing/selftests/resctrl/fill_buf.c
> > index 56ccbeae0638..f4880c962ec4 100644
> > --- a/tools/testing/selftests/resctrl/fill_buf.c
> > +++ b/tools/testing/selftests/resctrl/fill_buf.c
> > @@ -68,6 +68,8 @@ static void *malloc_and_init_memory(size_t s)
> > size_t s64;
> >
> > void *p = memalign(PAGE_SIZE, s);
>
> This may also be a good time to stop using an obsolete call?
Sure, I can add another patch to change that to posix_memalign().
> > + if (!p)
> > + return p;
>
> Could you please return NULL explicitly?
I'll change it.
Thanks for you comments.
--
i.
next prev parent reply other threads:[~2023-02-14 9:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-08 9:30 [PATCH 0/4] selftests/resctrl: Fixes to error handling logic Ilpo Järvinen
2023-02-08 9:30 ` [PATCH 1/4] selftests/resctrl: Return error if memory is not allocated Ilpo Järvinen
2023-02-14 1:00 ` Reinette Chatre
2023-02-14 9:32 ` Ilpo Järvinen [this message]
2023-02-14 17:01 ` Reinette Chatre
2023-02-08 9:30 ` [PATCH 2/4] selftests/resctrl: Move ->setup() call outside of test specific branches Ilpo Järvinen
2023-02-08 9:30 ` [PATCH 3/4] selftests/resctrl: Allow ->setup() to return errors Ilpo Järvinen
2023-02-08 9:30 ` [PATCH 4/4] selftests/resctrl: Check for return value after write_schemata() Ilpo Järvinen
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=a4b44d-23f8-6df1-e494-908fbd43b732@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=babu.moger@amd.com \
--cc=fenghua.yu@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=reinette.chatre@intel.com \
--cc=sai.praneeth.prakhya@intel.com \
--cc=shuah@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).