Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1483827
| From | Wei Yongjun <weiyj.lk@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH -next] staging: android: ion: Fix return value check in hi6220_ion_probe() |
| Date | 2016-09-15 04:30 +0200 |
| Message-ID | <shuB3-Wi-11@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
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))
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH -next] staging: android: ion: Fix return value check in hi6220_ion_probe() Wei Yongjun <weiyj.lk@gmail.com> - 2016-09-15 04:30 +0200
Re: [PATCH -next] staging: android: ion: Fix return value check in hi6220_ion_probe() Laura Abbott <labbott@redhat.com> - 2016-09-16 04:20 +0200
Re: [PATCH -next] staging: android: ion: Fix return value check in hi6220_ion_probe() Sumit Semwal <sumit.semwal@linaro.org> - 2016-09-16 04:30 +0200
csiph-web