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
2b6412de
Commit
2b6412de
authored
Feb 19, 2003
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] PCI i386: remove large stack usage in pci_sanity_check()
parent
37b11faa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
10 deletions
+24
-10
arch/i386/pci/direct.c
arch/i386/pci/direct.c
+24
-10
No files found.
arch/i386/pci/direct.c
View file @
2b6412de
...
@@ -196,21 +196,35 @@ static struct pci_ops pci_direct_conf2 = {
...
@@ -196,21 +196,35 @@ static struct pci_ops pci_direct_conf2 = {
static
int
__devinit
pci_sanity_check
(
struct
pci_ops
*
o
)
static
int
__devinit
pci_sanity_check
(
struct
pci_ops
*
o
)
{
{
u32
x
=
0
;
u32
x
=
0
;
struct
pci_bus
bus
;
/* Fake bus and device */
int
retval
=
0
;
struct
pci_dev
dev
;
struct
pci_bus
*
bus
;
/* Fake bus and device */
struct
pci_dev
*
dev
;
if
(
pci_probe
&
PCI_NO_CHECKS
)
if
(
pci_probe
&
PCI_NO_CHECKS
)
return
1
;
return
1
;
bus
.
number
=
0
;
dev
.
bus
=
&
bus
;
bus
=
kmalloc
(
sizeof
(
*
bus
),
GFP_ATOMIC
);
for
(
dev
.
devfn
=
0
;
dev
.
devfn
<
0x100
;
dev
.
devfn
++
)
dev
=
kmalloc
(
sizeof
(
*
dev
),
GFP_ATOMIC
);
if
((
!
o
->
read
(
&
bus
,
dev
.
devfn
,
PCI_CLASS_DEVICE
,
2
,
&
x
)
&&
if
(
!
bus
||
!
dev
)
{
printk
(
KERN_ERR
"Out of memory in %s
\n
"
,
__FUNCTION__
);
goto
exit
;
}
bus
->
number
=
0
;
dev
->
bus
=
bus
;
for
(
dev
->
devfn
=
0
;
dev
->
devfn
<
0x100
;
dev
->
devfn
++
)
if
((
!
o
->
read
(
bus
,
dev
->
devfn
,
PCI_CLASS_DEVICE
,
2
,
&
x
)
&&
(
x
==
PCI_CLASS_BRIDGE_HOST
||
x
==
PCI_CLASS_DISPLAY_VGA
))
||
(
x
==
PCI_CLASS_BRIDGE_HOST
||
x
==
PCI_CLASS_DISPLAY_VGA
))
||
(
!
o
->
read
(
&
bus
,
dev
.
devfn
,
PCI_VENDOR_ID
,
2
,
&
x
)
&&
(
!
o
->
read
(
bus
,
dev
->
devfn
,
PCI_VENDOR_ID
,
2
,
&
x
)
&&
(
x
==
PCI_VENDOR_ID_INTEL
||
x
==
PCI_VENDOR_ID_COMPAQ
)))
(
x
==
PCI_VENDOR_ID_INTEL
||
x
==
PCI_VENDOR_ID_COMPAQ
)))
{
return
1
;
retval
=
1
;
goto
exit
;
}
DBG
(
"PCI: Sanity check failed
\n
"
);
DBG
(
"PCI: Sanity check failed
\n
"
);
return
0
;
exit:
kfree
(
dev
);
kfree
(
bus
);
return
retval
;
}
}
static
int
__init
pci_direct_init
(
void
)
static
int
__init
pci_direct_init
(
void
)
...
...
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