Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix potential reference count leak in vinput #278

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

NOVBobLee
Copy link
Collaborator

In the export_store function, when vinput_register_vdevice fails, the current error handling process calls device_unregister followed by vinput_destroy_vdevice. However, the device_unregister here triggers its release function, which already includes a call to vinput_destroy_vdevice. As a result, vinput_destroy_vdevice is called twice. Since vinput_destroy_vdevice contains module_put, this double call must be avoided to prevent potential reference count issues.

In the export_store function, when vinput_register_vdevice fails, the
current error handling process calls device_unregister followed by
vinput_destroy_vdevice. However, the device_unregister here triggers its
release function, which already includes a call to
vinput_destroy_vdevice. As a result, vinput_destroy_vdevice is called
twice. Since vinput_destroy_vdevice contains module_put, this double
call must be avoided to prevent potential reference count issues.
@NOVBobLee
Copy link
Collaborator Author

Fixed typo.

@jserv jserv merged commit 6771385 into sysprog21:master Oct 25, 2024
1 check passed
@jserv
Copy link
Contributor

jserv commented Oct 25, 2024

Thank @NOVBobLee for contributing!

@NOVBobLee NOVBobLee deleted the fix_refcnt branch October 25, 2024 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants