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

gdev: graceful exit even after failed init #3

Merged
merged 1 commit into from
Jul 9, 2012
Merged

gdev: graceful exit even after failed init #3

merged 1 commit into from
Jul 9, 2012

Conversation

kris7t
Copy link
Contributor

@kris7t kris7t commented Jul 8, 2012

Repeated calls to gdev_major_exit will not cause a kernel panic.

If gdev_major_init fails, it will call gdev_major_exit. At module unload, gdev_major_exit is called again.
This might result in a kernel panic, which makes writing and testing gdev code extremely time-consuming.

In this patch, this issue is fixed by introducing some null checks into gdev_major_exit and related code.
Thus it is safe the call gdev_major_exit several times in a row, effectively making the second and later calls
a no-op.

Repeated calls to gdev_major_exit will not cause a kernel panic.
shinpei0208 added a commit that referenced this pull request Jul 9, 2012
gdev: graceful exit even after failed init (committed by kris7topher)
@shinpei0208 shinpei0208 merged commit 0e4fa54 into shinpei0208:master Jul 9, 2012
@shinpei0208
Copy link
Owner

Hi Kristóf,

This is great! I have merged your commit to the master branch.

Thanks,

  • Shinpei

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.

2 participants