Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1375156 > unrolled thread

[PATCH 4.4 093/210] staging: android: ion_test: fix check of platform_device_register_simple() error code

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2016-04-10 22:10 +0200
Last post2016-04-10 22:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4.4 093/210] staging: android: ion_test: fix check of platform_device_register_simple() error code Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 22:10 +0200

#1375156 — [PATCH 4.4 093/210] staging: android: ion_test: fix check of platform_device_register_simple() error code

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2016-04-10 22:10 +0200
Subject[PATCH 4.4 093/210] staging: android: ion_test: fix check of platform_device_register_simple() error code
Message-ID<rmtQe-22e-15@gated-at.bofh.it>
4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Vladimir Zapolskiy <vz@mleia.com>

commit ccbc2a9e7878ff09bcaed4893c2a2d3adbb797e2 upstream.

On error platform_device_register_simple() returns ERR_PTR() value,
check for NULL always fails. The change corrects the check itself and
propagates the returned error upwards.

Fixes: 81fb0b901397 ("staging: android: ion_test: unregister the platform device")
Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/android/ion/ion_test.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/staging/android/ion/ion_test.c
+++ b/drivers/staging/android/ion/ion_test.c
@@ -285,8 +285,8 @@ static int __init ion_test_init(void)
 {
 	ion_test_pdev = platform_device_register_simple("ion-test",
 							-1, NULL, 0);
-	if (!ion_test_pdev)
-		return -ENODEV;
+	if (IS_ERR(ion_test_pdev))
+		return PTR_ERR(ion_test_pdev);
 
 	return platform_driver_probe(&ion_test_platform_driver, ion_test_probe);
 }

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web