git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
sound
/
isa
/
wavefront
/
wavefront_fx.c
diff --git
a/sound/isa/wavefront/wavefront_fx.c
b/sound/isa/wavefront/wavefront_fx.c
index
92aa782
..
180661c
100644
(file)
--- a/
sound/isa/wavefront/wavefront_fx.c
+++ b/
sound/isa/wavefront/wavefront_fx.c
@@
-460,7
+460,7
@@
snd_wavefront_fx_detect (snd_wavefront_t *dev)
}
int
}
int
-snd_wavefront_fx_open (s
nd_hwdep_t
*hw, struct file *file)
+snd_wavefront_fx_open (s
truct snd_hwdep
*hw, struct file *file)
{
if (!try_module_get(hw->card->module))
{
if (!try_module_get(hw->card->module))
@@
-470,7
+470,7
@@
snd_wavefront_fx_open (snd_hwdep_t *hw, struct file *file)
}
int
}
int
-snd_wavefront_fx_release (s
nd_hwdep_t
*hw, struct file *file)
+snd_wavefront_fx_release (s
truct snd_hwdep
*hw, struct file *file)
{
module_put(hw->card->module);
{
module_put(hw->card->module);
@@
-478,16
+478,17
@@
snd_wavefront_fx_release (snd_hwdep_t *hw, struct file *file)
}
int
}
int
-snd_wavefront_fx_ioctl (s
nd_hwdep_t
*sdev, struct file *file,
+snd_wavefront_fx_ioctl (s
truct snd_hwdep
*sdev, struct file *file,
unsigned int cmd, unsigned long arg)
{
unsigned int cmd, unsigned long arg)
{
- s
nd_card_t
*card;
+ s
truct snd_card
*card;
snd_wavefront_card_t *acard;
snd_wavefront_t *dev;
wavefront_fx_info r;
snd_wavefront_card_t *acard;
snd_wavefront_t *dev;
wavefront_fx_info r;
- unsigned short
page_data[256]
;
+ unsigned short
*page_data = NULL
;
unsigned short *pd;
unsigned short *pd;
+ int err = 0;
snd_assert(sdev->card != NULL, return -ENODEV);
snd_assert(sdev->card != NULL, return -ENODEV);
@@
-514,23
+515,29
@@
snd_wavefront_fx_ioctl (snd_hwdep_t *sdev, struct file *file,
} else if (r.data[2] == 1) {
pd = (unsigned short *) &r.data[3];
} else {
} else if (r.data[2] == 1) {
pd = (unsigned short *) &r.data[3];
} else {
- if (r.data[2] >
(long)sizeof (page_data)
) {
+ if (r.data[2] >
256
) {
snd_printk ("cannot write "
snd_printk ("cannot write "
- ">
255
bytes to FX\n");
+ ">
512
bytes to FX\n");
return -EIO;
}
return -EIO;
}
+ page_data = kmalloc(r.data[2] * sizeof(short), GFP_KERNEL);
+ if (!page_data)
+ return -ENOMEM;
if (copy_from_user (page_data,
(unsigned char __user *) r.data[3],
if (copy_from_user (page_data,
(unsigned char __user *) r.data[3],
- r.data[2]))
+ r.data[2] * sizeof(short))) {
+ kfree(page_data);
return -EFAULT;
return -EFAULT;
+ }
pd = page_data;
}
pd = page_data;
}
- wavefront_fx_memset (dev,
+
err =
wavefront_fx_memset (dev,
r.data[0], /* page */
r.data[1], /* addr */
r.data[2], /* cnt */
pd);
r.data[0], /* page */
r.data[1], /* addr */
r.data[2], /* cnt */
pd);
+ kfree(page_data);
break;
default:
break;
default:
@@
-538,7
+545,7
@@
snd_wavefront_fx_ioctl (snd_hwdep_t *sdev, struct file *file,
r.request);
return -ENOTTY;
}
r.request);
return -ENOTTY;
}
- return
0
;
+ return
err
;
}
/* YSS225 initialization.
}
/* YSS225 initialization.