X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fopenwrt.git;a=blobdiff_plain;f=target%2Flinux%2Fbrcm2708%2Fpatches-4.19%2F950-0207-staging-vchiq_arm-Improve-error-handling-on-loading-.patch;fp=target%2Flinux%2Fbrcm2708%2Fpatches-4.19%2F950-0207-staging-vchiq_arm-Improve-error-handling-on-loading-.patch;h=087e3e50253b79621a092b3790e0dd1f353518e0;hp=0000000000000000000000000000000000000000;hb=84d555aa74434392b682fd9eb0fa701c89a046d6;hpb=953973c2991e8640549a55df7a0574a1abac8644 diff --git a/target/linux/brcm2708/patches-4.19/950-0207-staging-vchiq_arm-Improve-error-handling-on-loading-.patch b/target/linux/brcm2708/patches-4.19/950-0207-staging-vchiq_arm-Improve-error-handling-on-loading-.patch new file mode 100644 index 0000000000..087e3e5025 --- /dev/null +++ b/target/linux/brcm2708/patches-4.19/950-0207-staging-vchiq_arm-Improve-error-handling-on-loading-.patch @@ -0,0 +1,39 @@ +From 73979b06255c3b7b536a53d09ea095aec8ed37aa Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Mon, 3 Dec 2018 12:50:38 +0000 +Subject: [PATCH] staging: vchiq_arm: Improve error handling on loading + drivers + +The handling of loading platform drivers requires checking IS_ERR +for the pointer on unload. +If the driver fails to load, NULL the pointer during probe as +platform_device_unregister already checks for NULL. + +Signed-off-by: Dave Stevenson +--- + .../vc04_services/interface/vchiq_arm/vchiq_arm.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c ++++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +@@ -3654,6 +3654,8 @@ static int vchiq_probe(struct platform_d + MAJOR(vchiq_devid), MINOR(vchiq_devid)); + + bcm2835_camera = vchiq_register_child(pdev, "bcm2835-camera"); ++ if (IS_ERR(bcm2835_camera)) ++ bcm2835_camera = NULL; + + return 0; + +@@ -3670,8 +3672,9 @@ failed_platform_init: + + static int vchiq_remove(struct platform_device *pdev) + { +- if (!IS_ERR(bcm2835_camera)) +- platform_device_unregister(bcm2835_camera); ++ platform_device_unregister(bcm2835_codec); ++ platform_device_unregister(bcm2835_camera); ++ platform_device_unregister(vcsm_cma); + vchiq_debugfs_deinit(); + device_destroy(vchiq_class, vchiq_devid); + class_destroy(vchiq_class);