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
nexedi
linux
Commits
71ffd957
Commit
71ffd957
authored
Nov 26, 2002
by
Christoph Hellwig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[XFS] Fix unchecked kmalloc() in pagebuf
SGI Modid: 2.5.x-xfs:slinx:132859a
parent
cebce9d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
fs/xfs/pagebuf/page_buf.c
fs/xfs/pagebuf/page_buf.c
+16
-7
No files found.
fs/xfs/pagebuf/page_buf.c
View file @
71ffd957
...
...
@@ -245,19 +245,27 @@ typedef struct a_list {
STATIC
a_list_t
*
as_free_head
;
STATIC
int
as_list_len
;
/*
* Try to batch vunmaps because they are costly.
*/
STATIC
void
free_address
(
void
*
addr
)
{
a_list_t
*
aentry
;
spin_lock
(
&
as_lock
);
aentry
=
kmalloc
(
sizeof
(
a_list_t
),
GFP_ATOMIC
);
aentry
->
next
=
as_free_head
;
aentry
->
vm_addr
=
addr
;
as_free_head
=
aentry
;
as_list_len
++
;
spin_unlock
(
&
as_lock
);
if
(
aentry
)
{
spin_lock
(
&
as_lock
);
aentry
->
next
=
as_free_head
;
aentry
->
vm_addr
=
addr
;
as_free_head
=
aentry
;
as_list_len
++
;
spin_unlock
(
&
as_lock
);
}
else
{
vunmap
(
addr
);
}
}
STATIC
void
...
...
@@ -265,7 +273,8 @@ purge_addresses(void)
{
a_list_t
*
aentry
,
*
old
;
if
(
as_free_head
==
NULL
)
return
;
if
(
as_free_head
==
NULL
)
return
;
spin_lock
(
&
as_lock
);
aentry
=
as_free_head
;
...
...
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