Merge pull request #279 from NOVBobLee/fix_memleak
Some checks failed
build-deploy-assets / build (push) Has been cancelled
deploy-github-page / build (push) Has been cancelled
status-checks / validate (push) Has been cancelled

Fix potential memory leak in vinput
This commit is contained in:
Jim Huang 2024-10-26 23:31:39 +08:00 committed by GitHub
commit e3e2ee35af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -283,10 +283,12 @@ static ssize_t export_store(struct class *class, struct class_attribute *attr,
return len; return len;
fail_register_vinput: fail_register_vinput:
input_free_device(vinput->input);
device_unregister(&vinput->dev); device_unregister(&vinput->dev);
/* avoid calling vinput_destroy_vdevice() twice */ /* avoid calling vinput_destroy_vdevice() twice */
return err; return err;
fail_register: fail_register:
input_free_device(vinput->input);
vinput_destroy_vdevice(vinput); vinput_destroy_vdevice(vinput);
fail: fail:
return err; return err;