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
ae7acefc
Commit
ae7acefc
authored
Feb 07, 2003
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] Compaq PCI Hotplug: fix checker memory leak bugs.
parent
dc2d7266
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
27 deletions
+40
-27
drivers/hotplug/cpqphp_nvram.c
drivers/hotplug/cpqphp_nvram.c
+40
-27
No files found.
drivers/hotplug/cpqphp_nvram.c
View file @
ae7acefc
...
...
@@ -473,7 +473,7 @@ int compaq_nvram_load (void *rom_start, struct controller *ctrl)
p_byte
+=
3
;
if
(
p_byte
>
((
u8
*
)
p_EV_header
+
evbuffer_length
))
return
(
2
)
;
return
2
;
bus
=
p_ev_ctrl
->
bus
;
device
=
p_ev_ctrl
->
device
;
...
...
@@ -490,20 +490,20 @@ int compaq_nvram_load (void *rom_start, struct controller *ctrl)
p_byte
+=
4
;
if
(
p_byte
>
((
u8
*
)
p_EV_header
+
evbuffer_length
))
return
(
2
)
;
return
2
;
// Skip forward to the next entry
p_byte
+=
(
nummem
+
numpmem
+
numio
+
numbus
)
*
8
;
if
(
p_byte
>
((
u8
*
)
p_EV_header
+
evbuffer_length
))
return
(
2
)
;
return
2
;
p_ev_ctrl
=
(
struct
ev_hrt_ctrl
*
)
p_byte
;
p_byte
+=
3
;
if
(
p_byte
>
((
u8
*
)
p_EV_header
+
evbuffer_length
))
return
(
2
)
;
return
2
;
bus
=
p_ev_ctrl
->
bus
;
device
=
p_ev_ctrl
->
device
;
...
...
@@ -518,7 +518,7 @@ int compaq_nvram_load (void *rom_start, struct controller *ctrl)
p_byte
+=
4
;
if
(
p_byte
>
((
u8
*
)
p_EV_header
+
evbuffer_length
))
return
(
2
)
;
return
2
;
while
(
nummem
--
)
{
mem_node
=
(
struct
pci_resource
*
)
kmalloc
(
sizeof
(
struct
pci_resource
),
GFP_KERNEL
);
...
...
@@ -530,15 +530,19 @@ int compaq_nvram_load (void *rom_start, struct controller *ctrl)
dbg
(
"mem base = %8.8x
\n
"
,
mem_node
->
base
);
p_byte
+=
4
;
if
(
p_byte
>
((
u8
*
)
p_EV_header
+
evbuffer_length
))
return
(
2
);
if
(
p_byte
>
((
u8
*
)
p_EV_header
+
evbuffer_length
))
{
kfree
(
mem_node
);
return
2
;
}
mem_node
->
length
=
*
(
u32
*
)
p_byte
;
dbg
(
"mem length = %8.8x
\n
"
,
mem_node
->
length
);
p_byte
+=
4
;
if
(
p_byte
>
((
u8
*
)
p_EV_header
+
evbuffer_length
))
return
(
2
);
if
(
p_byte
>
((
u8
*
)
p_EV_header
+
evbuffer_length
))
{
kfree
(
mem_node
);
return
2
;
}
mem_node
->
next
=
ctrl
->
mem_head
;
ctrl
->
mem_head
=
mem_node
;
...
...
@@ -554,15 +558,19 @@ int compaq_nvram_load (void *rom_start, struct controller *ctrl)
dbg
(
"pre-mem base = %8.8x
\n
"
,
p_mem_node
->
base
);
p_byte
+=
4
;
if
(
p_byte
>
((
u8
*
)
p_EV_header
+
evbuffer_length
))
return
(
2
);
if
(
p_byte
>
((
u8
*
)
p_EV_header
+
evbuffer_length
))
{
kfree
(
p_mem_node
);
return
2
;
}
p_mem_node
->
length
=
*
(
u32
*
)
p_byte
;
dbg
(
"pre-mem length = %8.8x
\n
"
,
p_mem_node
->
length
);
p_byte
+=
4
;
if
(
p_byte
>
((
u8
*
)
p_EV_header
+
evbuffer_length
))
return
(
2
);
if
(
p_byte
>
((
u8
*
)
p_EV_header
+
evbuffer_length
))
{
kfree
(
p_mem_node
);
return
2
;
}
p_mem_node
->
next
=
ctrl
->
p_mem_head
;
ctrl
->
p_mem_head
=
p_mem_node
;
...
...
@@ -578,15 +586,19 @@ int compaq_nvram_load (void *rom_start, struct controller *ctrl)
dbg
(
"io base = %8.8x
\n
"
,
io_node
->
base
);
p_byte
+=
4
;
if
(
p_byte
>
((
u8
*
)
p_EV_header
+
evbuffer_length
))
return
(
2
);
if
(
p_byte
>
((
u8
*
)
p_EV_header
+
evbuffer_length
))
{
kfree
(
io_node
);
return
2
;
}
io_node
->
length
=
*
(
u32
*
)
p_byte
;
dbg
(
"io length = %8.8x
\n
"
,
io_node
->
length
);
p_byte
+=
4
;
if
(
p_byte
>
((
u8
*
)
p_EV_header
+
evbuffer_length
))
return
(
2
);
if
(
p_byte
>
((
u8
*
)
p_EV_header
+
evbuffer_length
))
{
kfree
(
io_node
);
return
2
;
}
io_node
->
next
=
ctrl
->
io_head
;
ctrl
->
io_head
=
io_node
;
...
...
@@ -601,15 +613,18 @@ int compaq_nvram_load (void *rom_start, struct controller *ctrl)
bus_node
->
base
=
*
(
u32
*
)
p_byte
;
p_byte
+=
4
;
if
(
p_byte
>
((
u8
*
)
p_EV_header
+
evbuffer_length
))
return
(
2
);
if
(
p_byte
>
((
u8
*
)
p_EV_header
+
evbuffer_length
))
{
kfree
(
bus_node
);
return
2
;
}
bus_node
->
length
=
*
(
u32
*
)
p_byte
;
p_byte
+=
4
;
if
(
p_byte
>
((
u8
*
)
p_EV_header
+
evbuffer_length
))
return
(
2
);
if
(
p_byte
>
((
u8
*
)
p_EV_header
+
evbuffer_length
))
{
kfree
(
bus_node
);
return
2
;
}
bus_node
->
next
=
ctrl
->
bus_head
;
ctrl
->
bus_head
=
bus_node
;
...
...
@@ -623,13 +638,11 @@ int compaq_nvram_load (void *rom_start, struct controller *ctrl)
rc
&=
cpqhp_resource_sort_and_combine
(
&
(
ctrl
->
io_head
));
rc
&=
cpqhp_resource_sort_and_combine
(
&
(
ctrl
->
bus_head
));
if
(
rc
)
{
if
(
rc
)
return
(
rc
);
}
}
else
{
if
((
evbuffer
[
0
]
!=
0
)
&&
(
!
ctrl
->
push_flag
))
{
return
(
1
);
}
if
((
evbuffer
[
0
]
!=
0
)
&&
(
!
ctrl
->
push_flag
))
return
1
;
}
return
0
;
...
...
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