* [PATCH -next] spi: fix return value check in ce4100_spi_probe()
@ 2013-02-22 2:52 Wei Yongjun
[not found] ` <CAPgLHd-PhE2igUQOeg90H98Ni55DwfYdp0D52uaBK0=J3M1V+g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-03-02 3:58 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2013-02-22 2:52 UTC (permalink / raw)
To: eric.y.miao-Re5JQEeQqe8AvxtiuMwx3w, linux-lFZ/pmaqli7XmaaqVzeoHQ,
haojian.zhuang-Re5JQEeQqe8AvxtiuMwx3w,
grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
From: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
In case of error, the function platform_device_register_full()
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 <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
---
drivers/spi/spi-pxa2xx-pci.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-pxa2xx-pci.c b/drivers/spi/spi-pxa2xx-pci.c
index 364964d..0a11dcfc 100644
--- a/drivers/spi/spi-pxa2xx-pci.c
+++ b/drivers/spi/spi-pxa2xx-pci.c
@@ -47,8 +47,8 @@ static int ce4100_spi_probe(struct pci_dev *dev,
pi.size_data = sizeof(spi_pdata);
pdev = platform_device_register_full(&pi);
- if (!pdev)
- return -ENOMEM;
+ if (IS_ERR(pdev))
+ return PTR_ERR(pdev);
pci_set_drvdata(dev, pdev);
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] spi: fix return value check in ce4100_spi_probe()
[not found] ` <CAPgLHd-PhE2igUQOeg90H98Ni55DwfYdp0D52uaBK0=J3M1V+g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2013-02-22 9:33 ` Mika Westerberg
0 siblings, 0 replies; 3+ messages in thread
From: Mika Westerberg @ 2013-02-22 9:33 UTC (permalink / raw)
To: Wei Yongjun
Cc: linux-lFZ/pmaqli7XmaaqVzeoHQ,
broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
haojian.zhuang-Re5JQEeQqe8AvxtiuMwx3w,
yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY,
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
eric.y.miao-Re5JQEeQqe8AvxtiuMwx3w,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
On Fri, Feb 22, 2013 at 10:52:35AM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
>
> In case of error, the function platform_device_register_full()
> 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 <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
Nice catch!
Acked-by: Mika Westerberg <mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] spi: fix return value check in ce4100_spi_probe()
2013-02-22 2:52 [PATCH -next] spi: fix return value check in ce4100_spi_probe() Wei Yongjun
[not found] ` <CAPgLHd-PhE2igUQOeg90H98Ni55DwfYdp0D52uaBK0=J3M1V+g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2013-03-02 3:58 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2013-03-02 3:58 UTC (permalink / raw)
To: Wei Yongjun
Cc: eric.y.miao, linux, haojian.zhuang, grant.likely, yongjun_wei,
linux-arm-kernel, spi-devel-general, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 327 bytes --]
On Fri, Feb 22, 2013 at 10:52:35AM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> In case of error, the function platform_device_register_full()
> returns ERR_PTR() and never returns NULL. The NULL test in the
> return value check should be replaced with IS_ERR().
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-03-02 3:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-22 2:52 [PATCH -next] spi: fix return value check in ce4100_spi_probe() Wei Yongjun
[not found] ` <CAPgLHd-PhE2igUQOeg90H98Ni55DwfYdp0D52uaBK0=J3M1V+g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-22 9:33 ` Mika Westerberg
2013-03-02 3:58 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).