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
e2ac95ce
Commit
e2ac95ce
authored
May 28, 2003
by
Matt Domsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dynids: free dynids on driver unload
parent
253e6815
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
drivers/pci/pci-driver.c
drivers/pci/pci-driver.c
+17
-0
No files found.
drivers/pci/pci-driver.c
View file @
e2ac95ce
...
@@ -315,6 +315,22 @@ pci_init_dynids(struct pci_dynids *dynids)
...
@@ -315,6 +315,22 @@ pci_init_dynids(struct pci_dynids *dynids)
INIT_LIST_HEAD
(
&
dynids
->
list
);
INIT_LIST_HEAD
(
&
dynids
->
list
);
}
}
static
void
pci_free_dynids
(
struct
pci_driver
*
drv
)
{
struct
list_head
*
pos
,
*
n
;
struct
dynid
*
dynid
;
spin_lock
(
&
drv
->
dynids
.
lock
);
list_for_each_safe
(
pos
,
n
,
&
drv
->
dynids
.
list
)
{
dynid
=
list_entry
(
pos
,
struct
dynid
,
node
);
list_del
(
&
dynid
->
node
);
kfree
(
dynid
);
}
spin_unlock
(
&
drv
->
dynids
.
lock
);
}
/**
/**
* pci_register_driver - register a new pci driver
* pci_register_driver - register a new pci driver
* @drv: the driver structure to register
* @drv: the driver structure to register
...
@@ -363,6 +379,7 @@ void
...
@@ -363,6 +379,7 @@ void
pci_unregister_driver
(
struct
pci_driver
*
drv
)
pci_unregister_driver
(
struct
pci_driver
*
drv
)
{
{
driver_unregister
(
&
drv
->
driver
);
driver_unregister
(
&
drv
->
driver
);
pci_free_dynids
(
drv
);
}
}
static
struct
pci_driver
pci_compat_driver
=
{
static
struct
pci_driver
pci_compat_driver
=
{
...
...
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