From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Cyrus-Session-Id: sloti22d1t05-497716-1518798458-2-4832441009234812758 X-Sieve: CMU Sieve 3.0 X-Spam-known-sender: no X-Spam-score: 0.0 X-Spam-hits: BAYES_00 -1.9, HEADER_FROM_DIFFERENT_DOMAINS 0.001, RCVD_IN_DNSWL_MED -2.3, SPF_PASS -0.001, LANGUAGES en, BAYES_USED global, SA_VERSION 3.4.0 X-Spam-source: IP='140.211.166.136', Host='smtp3.osuosl.org', Country='US', FromHeader='org', MailFrom='org' X-Spam-charsets: plain='us-ascii' X-Resolved-to: greg@kroah.com X-Delivered-to: greg@kroah.com X-Mail-from: driverdev-devel-bounces@linuxdriverproject.org ARC-Seal: i=1; a=rsa-sha256; cv=none; d=messagingengine.com; s=arctest; t=1518798458; b=IdEcoJgRiSAC5MpabilQ5f4zaebcImgg/Lc+aBH8KSfNgY9 0KPJad/+1ZDm1ieDYAhXEdhAo+rmODaKKuclGlXIyMObu1/EKSiuM4n+0V1zC5MW 11g7wZfct0AwHkl/eNy8Jid6/Y+ZT/THi0k7gccHXPq5TO+5XktRBtC8/0RYiBPQ Q9JdWwK5TQNRdQIg33g7o8gfFp+qdGsHVtWYf0QjijnSMlsc4lNUmWqJgbg5yS+i yToxuByWAkLo702Yprmu+e+pf1X4CCp00S+o0yKsebCWhElNKXnmpX9mYzQY/fTg A3fwXV8EH+e55telA9tT1Wida82FYTG7eCNVAgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=date:from:to:subject:message-id :references:mime-version:in-reply-to:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:cc:content-type :content-transfer-encoding:sender; s=arctest; t=1518798458; bh=a aM0k4tY1fDljx38RCyuJgnP3qC5Z5UMX0E6/QNSKc4=; b=oTibA7Qtu/rYfdvzu 6MKa7qZ6TxAhbk044Cqwv6pp+WQnArQ3TQtMZX84/Ib0MRS3t+qm93FJrfIaHwAa vpyVo60wGTuKdegazNS8KbUaXt1T1XyNZt/xW9pOTa7hXYfMlx1TopZiGTIZJbP9 MCYoVUqyt30W4Om9/h/4qDpyTi66mDYrG7BJDDSKUbHpF/D6/jAHVxX/1VJr4cmE NHmENqoA5P4IDMHgPaK22BOIs5nWmlRiOypzGI4OliGVaz1INtloJXF89ek6jy3j MLOGz13gUV+7WcjM5GtG1r7rHH29fJAQSKtEHQyuTOY9/6GyruquuG40g1fTFoNf KPKLw== ARC-Authentication-Results: i=1; mx5.messagingengine.com; arc=none (no signatures found); dkim=none (no signatures found); dmarc=none (p=none,has-list-id=yes,d=none) header.from=linuxfoundation.org; iprev=pass policy.iprev=140.211.166.136 (smtp3.osuosl.org); spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org smtp.helo=silver.osuosl.org; x-aligned-from=fail; x-ptr=fail x-ptr-helo=silver.osuosl.org x-ptr-lookup=smtp3.osuosl.org; x-return-mx=pass smtp.domain=linuxdriverproject.org smtp.result=pass smtp_is_org_domain=yes header.domain=linuxfoundation.org header.result=pass header_is_org_domain=yes; x-tls=pass version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128 Authentication-Results: mx5.messagingengine.com; arc=none (no signatures found); dkim=none (no signatures found); dmarc=none (p=none,has-list-id=yes,d=none) header.from=linuxfoundation.org; iprev=pass policy.iprev=140.211.166.136 (smtp3.osuosl.org); spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org smtp.helo=silver.osuosl.org; x-aligned-from=fail; x-ptr=fail x-ptr-helo=silver.osuosl.org x-ptr-lookup=smtp3.osuosl.org; x-return-mx=pass smtp.domain=linuxdriverproject.org smtp.result=pass smtp_is_org_domain=yes header.domain=linuxfoundation.org header.result=pass header_is_org_domain=yes; x-tls=pass version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128 X-Remote-Delivered-To: driverdev-devel@osuosl.org Date: Fri, 16 Feb 2018 17:27:32 +0100 From: Greg KH To: Yisheng Xie Subject: Re: [PATCH v2 4/9] staging: android: ion: Avoid NULL point in error path Message-ID: <20180216162732.GA18688@kroah.com> References: <1518432194-41536-1-git-send-email-xieyisheng1@huawei.com> <1518432194-41536-5-git-send-email-xieyisheng1@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1518432194-41536-5-git-send-email-xieyisheng1@huawei.com> User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.24 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, sumit.semwal@linaro.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" X-getmail-retrieved-from-mailbox: INBOX X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 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. thanks, greg k-h _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel