Skip to content

Commit

Permalink
staging: vchiq_arm: Fix platform device unregistration
Browse files Browse the repository at this point in the history
In error case platform_device_register_data would return an ERR_PTR
instead of NULL. So we better check this before unregistration.

Fixes: 37b7b30 ("staging/vc04_services: Register a platform device for the camera driver.")
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
  • Loading branch information
lategoodbye authored and Phil Elwell committed May 28, 2019
1 parent 53ac908 commit c7b8dd4
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -3578,7 +3578,8 @@ static int vchiq_probe(struct platform_device *pdev)

static int vchiq_remove(struct platform_device *pdev)
{
platform_device_unregister(bcm2835_camera);
if (!IS_ERR(bcm2835_camera))
platform_device_unregister(bcm2835_camera);
vchiq_debugfs_deinit();
device_destroy(vchiq_class, vchiq_devid);
cdev_del(&vchiq_cdev);
Expand Down

0 comments on commit c7b8dd4

Please sign in to comment.