forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
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);