From: Michael Ellerman <mpe@ellerman.id.au>
To: Nathan Fontenot <nfont@linux.vnet.ibm.com>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: Re: [v2] powerpc/pseries: Correct string length in pseries_of_derive_parent()
Date: Mon, 2 Nov 2015 20:41:30 +1100 (AEDT) [thread overview]
Message-ID: <20151102094130.A0131140E31@ozlabs.org> (raw)
In-Reply-To: <562F9C67.3040207@linux.vnet.ibm.com>
On Tue, 2015-27-10 at 15:46:47 UTC, Nathan Fontenot wrote:
> Commit a030e1e4bbd085bbcfd0a23f8d355fcd41f39bed make a change to use
> kstrndup() instead of kmalloc() + strlcpy() in the pseries_of_derive_parent()
> routine that introduces a subtle change in the parent path name generated.
> The kstrndup() routine will copy n characters followed by a terminating null,
> whereas strlcpy() will copy n-1 characters and add a terminating null.
>
> This slight difference results in having a parent path that includes the
> tailing '/' character, "/cpus/" vs. "/cpus". This then causes the subsequent
> call to of_find_node_by_path() to fail, and in the case of DLPAR add
> operations the DLPAR request fails.
>
> This patch decrements the pointer returned from kbasename() to point to the
> '/' character before the base name instead of the base name. This then
> adjusts the string length calculations to not include the trailing '/'
> in the parent path name.
>
> Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/f755ecfb8cec7b19dff84295
cheers
prev parent reply other threads:[~2015-11-02 9:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-27 15:46 [PATCH v2] powerpc/pseries: Correct string length in pseries_of_derive_parent() Nathan Fontenot
2015-10-27 15:52 ` Andy Shevchenko
2015-11-02 9:41 ` Michael Ellerman [this message]
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=20151102094130.A0131140E31@ozlabs.org \
--to=mpe@ellerman.id.au \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=nfont@linux.vnet.ibm.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;
as well as URLs for NNTP newsgroup(s).