Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
0cba114f
Commit
0cba114f
authored
Mar 23, 2003
by
Dave Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] plug DRM memory leak on exit paths.
Spotted by Oleg Drokin
parent
4c32714d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
drivers/char/drm/drm_drv.h
drivers/char/drm/drm_drv.h
+16
-8
No files found.
drivers/char/drm/drm_drv.h
View file @
0cba114f
...
...
@@ -581,8 +581,10 @@ static int __init drm_init( void )
init_timer
(
&
dev
->
timer
);
init_waitqueue_head
(
&
dev
->
context_wait
);
if
((
DRM
(
minor
)[
i
]
=
DRM
(
stub_register
)(
DRIVER_NAME
,
&
DRM
(
fops
),
dev
))
<
0
)
return
-
EPERM
;
if
((
DRM
(
minor
)[
i
]
=
DRM
(
stub_register
)(
DRIVER_NAME
,
&
DRM
(
fops
),
dev
))
<
0
)
{
retcode
=
-
EPERM
;
goto
fail_reg
;
}
dev
->
device
=
MKDEV
(
DRM_MAJOR
,
DRM
(
minor
)[
i
]
);
dev
->
name
=
DRIVER_NAME
;
...
...
@@ -591,9 +593,8 @@ static int __init drm_init( void )
#if __MUST_HAVE_AGP
if
(
dev
->
agp
==
NULL
)
{
DRM_ERROR
(
"Cannot initialize the agpgart module.
\n
"
);
DRM
(
stub_unregister
)(
DRM
(
minor
)[
i
]);
DRM
(
takedown
)(
dev
);
return
-
ENOMEM
;
retcode
=
-
ENOMEM
;
goto
fail
;
}
#endif
#if __REALLY_HAVE_MTRR
...
...
@@ -609,9 +610,7 @@ static int __init drm_init( void )
retcode
=
DRM
(
ctxbitmap_init
)(
dev
);
if
(
retcode
)
{
DRM_ERROR
(
"Cannot allocate memory for context bitmap.
\n
"
);
DRM
(
stub_unregister
)(
DRM
(
minor
)[
i
]);
DRM
(
takedown
)(
dev
);
return
retcode
;
goto
fail
;
}
#endif
DRM_INFO
(
"Initialized %s %d.%d.%d %s on minor %d
\n
"
,
...
...
@@ -626,6 +625,15 @@ static int __init drm_init( void )
DRIVER_POSTINIT
();
return
0
;
fail:
DRM
(
stub_unregister
)(
DRM
(
minor
)[
i
]);
DRM
(
takedown
)(
dev
);
fail_reg:
kfree
(
DRM
(
device
));
kfree
(
DRM
(
minor
));
return
retcode
;
}
/* drm_cleanup is called via cleanup_module at module unload time.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment