From: Wei Yongjun <weiyj.lk@gmail.com>
To: Laura Abbott <labbott@redhat.com>,
sumit.semwal@linaro.org, gregkh@linuxfoundation.org,
arve@android.com, riandrews@android.com, bhaktipriya96@gmail.com,
yudongbin@hisilicon.com, puck.chen@hisilicon.com
Cc: Wei Yongjun <weiyongjun1@huawei.com>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH -next] staging: android: ion: Fix return value check in hi6220_ion_probe()
Date: Thu, 15 Sep 2016 02:20:43 +0000 [thread overview]
Message-ID: <1473906043-28683-1-git-send-email-weiyj.lk@gmail.com> (raw)
From: Wei Yongjun <weiyongjun1@huawei.com>
In case of error, the function ion_device_create() returns ERR_PTR() and
never returns NULL. The NULL test in the return value check should be
replaced with IS_ERR().
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/staging/android/ion/hisilicon/hi6220_ion.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/android/ion/hisilicon/hi6220_ion.c b/drivers/staging/android/ion/hisilicon/hi6220_ion.c
index f392db2..659aa71 100644
--- a/drivers/staging/android/ion/hisilicon/hi6220_ion.c
+++ b/drivers/staging/android/ion/hisilicon/hi6220_ion.c
@@ -49,8 +49,8 @@ static int hi6220_ion_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, ipdev);
ipdev->idev = ion_device_create(NULL);
- if (!ipdev->idev)
- return -ENOMEM;
+ if (IS_ERR(ipdev->idev))
+ return PTR_ERR(ipdev->idev);
ipdev->data = ion_parse_dt(pdev, hisi_heaps);
if (IS_ERR(ipdev->data))
next reply other threads:[~2016-09-15 2:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-15 2:20 Wei Yongjun [this message]
2016-09-16 2:10 ` Laura Abbott
2016-09-16 2:25 ` Sumit Semwal
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=1473906043-28683-1-git-send-email-weiyj.lk@gmail.com \
--to=weiyj.lk@gmail.com \
--cc=arve@android.com \
--cc=bhaktipriya96@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=labbott@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=puck.chen@hisilicon.com \
--cc=riandrews@android.com \
--cc=sumit.semwal@linaro.org \
--cc=weiyongjun1@huawei.com \
--cc=yudongbin@hisilicon.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®