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
c083a79a
Commit
c083a79a
authored
Nov 19, 2004
by
Alexander Viro
Committed by
Linus Torvalds
Nov 19, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] ad1889 annotations and fixes
fixed leaks on failure exits in ->probe()
parent
28b3389a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
17 deletions
+30
-17
sound/oss/ad1889.c
sound/oss/ad1889.c
+29
-16
sound/oss/ad1889.h
sound/oss/ad1889.h
+1
-1
No files found.
sound/oss/ad1889.c
View file @
c083a79a
...
...
@@ -1011,36 +1011,45 @@ static int __devinit ad1889_probe(struct pci_dev *pcidev, const struct pci_devic
if
(
!
(
pci_resource_flags
(
pcidev
,
0
)
&
IORESOURCE_MEM
))
{
printk
(
KERN_ERR
DEVNAME
": memory region not assigned
\n
"
);
goto
err_free_mem
;
goto
out1
;
}
if
(
pci_request_region
(
pcidev
,
0
,
DEVNAME
))
{
printk
(
KERN_ERR
DEVNAME
": unable to request memory region
\n
"
);
goto
out1
;
}
dev
->
regbase
=
ioremap_nocache
(
bar
,
AD_DSIOMEMSIZE
);
if
(
!
dev
->
regbase
)
{
printk
(
KERN_ERR
DEVNAME
": unable to remap iomem
\n
"
);
goto
out2
;
}
if
(
request_irq
(
pcidev
->
irq
,
ad1889_interrupt
,
SA_SHIRQ
,
DEVNAME
,
dev
)
!=
0
)
{
printk
(
KERN_ERR
DEVNAME
": unable to request interrupt
\n
"
);
goto
err_free_mem
;
goto
out3
;
}
request_mem_region
(
bar
,
AD_DSIOMEMSIZE
,
DEVNAME
);
dev
->
regbase
=
(
unsigned
long
)
ioremap_nocache
(
bar
,
AD_DSIOMEMSIZE
);
printk
(
KERN_INFO
DEVNAME
": %s at 0x%lx IRQ %d
\n
"
,
printk
(
KERN_INFO
DEVNAME
": %s at %p IRQ %d
\n
"
,
(
char
*
)
ent
->
driver_data
,
dev
->
regbase
,
pcidev
->
irq
);
if
(
ad1889_aclink_reset
(
pcidev
)
!=
0
)
goto
err_free_mem
;
goto
out4
;
/* register /dev/dsp */
if
((
dev
->
dev_audio
=
register_sound_dsp
(
&
ad1889_fops
,
-
1
))
<
0
)
{
printk
(
KERN_ERR
DEVNAME
": cannot register /dev/dsp
\n
"
);
goto
err_free_irq
;
goto
out4
;
}
if
((
err
=
ad1889_ac97_init
(
dev
,
0
))
!=
0
)
goto
err_free_dsp
;
goto
out5
;
/* XXX: cleanups */
if
(((
proc_root
=
proc_mkdir
(
"driver/ad1889"
,
NULL
))
==
NULL
)
||
create_proc_read_entry
(
"ac97"
,
S_IFREG
|
S_IRUGO
,
proc_root
,
ac97_read_proc
,
dev
->
ac97_codec
)
==
NULL
||
create_proc_read_entry
(
"info"
,
S_IFREG
|
S_IRUGO
,
proc_root
,
ad1889_read_proc
,
dev
)
==
NULL
)
goto
err_free_dsp
;
goto
out5
;
ad1889_initcfg
(
dev
);
...
...
@@ -1050,13 +1059,15 @@ static int __devinit ad1889_probe(struct pci_dev *pcidev, const struct pci_devic
return
0
;
err_free_dsp
:
out5
:
unregister_sound_dsp
(
dev
->
dev_audio
);
err_free_irq:
out4:
free_irq
(
pcidev
->
irq
,
dev
);
err_free_mem:
out3:
iounmap
(
dev
->
regbase
);
out2:
pci_release_region
(
pcidev
,
0
);
out1:
ad1889_free_dev
(
dev
);
pci_set_drvdata
(
pcidev
,
NULL
);
...
...
@@ -1072,10 +1083,12 @@ static void __devexit ad1889_remove(struct pci_dev *pcidev)
unregister_sound_mixer
(
dev
->
ac97_codec
->
dev_mixer
);
unregister_sound_dsp
(
dev
->
dev_audio
);
free_irq
(
pcidev
->
irq
,
dev
);
release_mem_region
(
dev
->
regbase
,
AD_DSIOMEMSIZE
);
iounmap
(
dev
->
regbase
);
pci_release_region
(
pcidev
,
0
);
/* any hw programming needed? */
ad1889_free_dev
(
dev
);
pci_set_drvdata
(
pcidev
,
NULL
);
}
MODULE_AUTHOR
(
"Randolph Chung"
);
...
...
sound/oss/ad1889.h
View file @
c083a79a
...
...
@@ -104,7 +104,7 @@ typedef struct ad1889_state {
}
ad1889_state_t
;
typedef
struct
ad1889_dev
{
unsigned
long
regbase
;
void
__iomem
*
regbase
;
struct
pci_dev
*
pci
;
spinlock_t
lock
;
...
...
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