Received: by 10.223.185.116 with SMTP id b49csp1678425wrg; Thu, 22 Feb 2018 01:01:23 -0800 (PST) X-Google-Smtp-Source: AH8x224/NzTcSyR0zCtvbrz7FfKQ0zeRUTL/4ljiBC9k+9jZnqmEZuDBHvpKDi3ckmSiftOxMgWY X-Received: by 10.99.61.75 with SMTP id k72mr4932097pga.384.1519290083099; Thu, 22 Feb 2018 01:01:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519290083; cv=none; d=google.com; s=arc-20160816; b=FUPUOtqGrZpOYOmbB3hsLROirgSgDTxSQAbgqts3f9BQnamMKmEM23vXxCD8ts5Yt7 L9AIEWKjbq6WoajPMhAMgaCXZf7qQ+N1OP0/HUxxnoqcV3WQR0Kik2HDsn3JR/IG4qyL Vnz7DPosYBGQxAMAdDiNa8DgIjx8vxc7PEHa9AjYDC91UNvt3kpBU8lp8I1cjBUJ6QL6 VlfLjilrbbekKnr4abeRs+nA0p8mpClFj1ZV3HPT6bobQ0yvoBX2jz44ry8g9BBpwc5S pFA6gjhbnFElfmll/jzs/xYXLHj7qhEQGi0aVA3QzXhNqSNt5ak1xrZE5vOMI+qFfjyJ CLrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:arc-authentication-results; bh=ZWJxv9Cm9Tfh1+X0jjlyN1eIcNIq4G/8a4gf/DGpmvc=; b=HE8jf78LKFmm4Icc8SQ7V5cqZgbJ6Tu3pF9sJj+Fuyj+8UZRF57PFtQB1X8fCC7zl2 rW8CGSUv+z6Q6YvUqn3ccWQT7Jx9waI+4HllOgpHgo/6a0sJmyfHvcOKEEqaCbaW7bbV IcIpZP5CcjQh/WSj6ffslzMRkVOA9pqSqcX38i7ZeMKPgXvwW87YT0bdWC89I/I01+0Z 0BugjovlxQxozJmlDE4beH+n/T2o2SHEJyBxmr5YmFDlQm2ffe3Jwagt2oW3u4CvnjdK WiyQCD4CGoo4BIcN02/NUBBZi70kULE+OOmXHGbNqtobOmumX0akotWhZI1TrH5IHrLv LwrA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u12-v6si1199103plr.462.2018.02.22.01.01.06; Thu, 22 Feb 2018 01:01:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752934AbeBVI7z (ORCPT + 99 others); Thu, 22 Feb 2018 03:59:55 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:5258 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752790AbeBVI7y (ORCPT ); Thu, 22 Feb 2018 03:59:54 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 145A6F84393AC; Thu, 22 Feb 2018 16:59:39 +0800 (CST) Received: from [127.0.0.1] (10.177.29.40) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.361.1; Thu, 22 Feb 2018 16:59:40 +0800 Subject: Re: [PATCH v2 4/9] staging: android: ion: Avoid NULL point in error path To: Greg KH References: <1518432194-41536-1-git-send-email-xieyisheng1@huawei.com> <1518432194-41536-5-git-send-email-xieyisheng1@huawei.com> <20180216162732.GA18688@kroah.com> CC: , , , From: Yisheng Xie Message-ID: <844e0fa1-cd03-8e2e-4a3e-6021a79610b4@huawei.com> Date: Thu, 22 Feb 2018 16:59:27 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20180216162732.GA18688@kroah.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.29.40] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Greg, Sorry for late responds for I was on vacation. On 2018/2/17 0:27, Greg KH wrote: > On Mon, Feb 12, 2018 at 06:43:09PM +0800, 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 >> Signed-off-by: Yisheng Xie >> --- >> 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 57e0d80..4b69372 100644 >> --- a/drivers/staging/android/ion/ion.c >> +++ b/drivers/staging/android/ion/ion.c >> @@ -564,13 +564,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); > > Really we can just remove this, there's no need to check the return > value of this debugfs call at all, it doesn't matter. Right, and I found that you have already patched this patch into next, should I send another version for the two patches your commented, or just send fix patches to fold? Thanks Yisheng > > thanks, > > greg k-h > > . >