mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-04 16:15:11 +00:00
staging: android: ion_test: fix check of platform_device_register_simple() error code
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: 81fb0b9013
("staging: android: ion_test: unregister the platform device")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f54e994c29
commit
ccbc2a9e78
1 changed files with 2 additions and 2 deletions
|
@ -285,8 +285,8 @@ static int __init ion_test_init(void)
|
||||||
{
|
{
|
||||||
ion_test_pdev = platform_device_register_simple("ion-test",
|
ion_test_pdev = platform_device_register_simple("ion-test",
|
||||||
-1, NULL, 0);
|
-1, NULL, 0);
|
||||||
if (!ion_test_pdev)
|
if (IS_ERR(ion_test_pdev))
|
||||||
return -ENODEV;
|
return PTR_ERR(ion_test_pdev);
|
||||||
|
|
||||||
return platform_driver_probe(&ion_test_platform_driver, ion_test_probe);
|
return platform_driver_probe(&ion_test_platform_driver, ion_test_probe);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue