From: Laura Abbott <labbott@redhat.com>
To: Yisheng Xie <xieyisheng1@huawei.com>, gregkh@linuxfoundation.org
Cc: sumit.semwal@linaro.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] staging: android: ion: Avoid NULL point in error path
Date: Tue, 6 Feb 2018 14:59:49 -0800 [thread overview]
Message-ID: <b5b6c497-94c8-16e8-a223-6c0e985a9acc@redhat.com> (raw)
In-Reply-To: <1517488447-41252-1-git-send-email-xieyisheng1@huawei.com>
On 02/01/2018 04:34 AM, Yisheng Xie wrote:
> If we failed to create debugfs for ion at ion_device_create, the
> debug_root of ion_device will be NULL, and then when try to create debug
> file for shrinker of heap it will be create on the top of debugfs. If we
> also failed to create this the debug file, it call dentry_path to found
> the path of debug_root, then a NULL point will occur.
>
> Fix this by avoiding call dentry_path, but show the debug name only when
> failed to create debug file for shrinker.
>
Acked-by: Laura Abbott <labbott@redhat.com>
> Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
> ---
> drivers/staging/android/ion/ion.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
> index f480885..3e41644 100644
> --- a/drivers/staging/android/ion/ion.c
> +++ b/drivers/staging/android/ion/ion.c
> @@ -570,13 +570,9 @@ void ion_device_add_heap(struct ion_heap *heap)
> debug_file = debugfs_create_file(
> debug_name, 0644, dev->debug_root, heap,
> &debug_shrink_fops);
> - if (!debug_file) {
> - char buf[256], *path;
> -
> - path = dentry_path(dev->debug_root, buf, 256);
> - pr_err("Failed to create heap shrinker debugfs at %s/%s\n",
> - path, debug_name);
> - }
> + if (!debug_file)
> + pr_err("Failed to create ion heap shrinker debugfs at %s\n",
> + debug_name);
> }
>
> dev->heap_cnt++;
>
next prev parent reply other threads:[~2018-02-06 22:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-01 12:34 Yisheng Xie
2018-02-01 12:34 ` [PATCH 2/2] staging: android: ion: Remove lable debugfs_done Yisheng Xie
2018-02-06 23:00 ` Laura Abbott
2018-02-06 22:59 ` Laura Abbott [this message]
2018-02-12 11:40 ` [PATCH 1/2] staging: android: ion: Avoid NULL point in error path Yisheng Xie
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=b5b6c497-94c8-16e8-a223-6c0e985a9acc@redhat.com \
--to=labbott@redhat.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sumit.semwal@linaro.org \
--cc=xieyisheng1@huawei.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
all inboxes | Powered by JetHome®