forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/arch/x86/kernel/pmem.c
....@@ -27,6 +27,11 @@
2727 * simply here to trigger the module to load on demand.
2828 */
2929 pdev = platform_device_alloc("e820_pmem", -1);
30
- return platform_device_add(pdev);
30
+
31
+ rc = platform_device_add(pdev);
32
+ if (rc)
33
+ platform_device_put(pdev);
34
+
35
+ return rc;
3136 }
3237 device_initcall(register_e820_pmem);