Commit aff8ccb8 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse: the rest of sound/* annotation

Remaining bits and pieces in sound/oss annotated.

At that point sound/* is done - we have no noise warnings left there.
parent 239429ed
...@@ -3344,10 +3344,10 @@ readbuf_word(int pos) ...@@ -3344,10 +3344,10 @@ readbuf_word(int pos)
/* read from user buffer */ /* read from user buffer */
if (readbuf_flags & AWE_SAMPLE_8BITS) { if (readbuf_flags & AWE_SAMPLE_8BITS) {
unsigned char cc; unsigned char cc;
get_user(cc, (unsigned __user char*)(readbuf_addr + readbuf_offs + pos)); get_user(cc, (unsigned char __user *)(readbuf_addr + readbuf_offs + pos));
c = (unsigned short)cc << 8; /* convert 8bit -> 16bit */ c = (unsigned short)cc << 8; /* convert 8bit -> 16bit */
} else { } else {
get_user(c, (unsigned __user short*)(readbuf_addr + readbuf_offs + pos * 2)); get_user(c, (unsigned short __user *)(readbuf_addr + readbuf_offs + pos * 2));
} }
if (readbuf_flags & AWE_SAMPLE_UNSIGNED) if (readbuf_flags & AWE_SAMPLE_UNSIGNED)
c ^= 0x8000; /* unsigned -> signed */ c ^= 0x8000; /* unsigned -> signed */
......
...@@ -218,7 +218,7 @@ static int __init kahlua_init_module(void) ...@@ -218,7 +218,7 @@ static int __init kahlua_init_module(void)
static void __devexit kahlua_cleanup_module(void) static void __devexit kahlua_cleanup_module(void)
{ {
return pci_unregister_driver(&kahlua_driver); pci_unregister_driver(&kahlua_driver);
} }
......
...@@ -822,7 +822,7 @@ static void opl3_hw_control(int dev, unsigned char *event) ...@@ -822,7 +822,7 @@ static void opl3_hw_control(int dev, unsigned char *event)
{ {
} }
static int opl3_load_patch(int dev, int format, const char *addr, static int opl3_load_patch(int dev, int format, const char __user *addr,
int offs, int count, int pmgr_flag) int offs, int count, int pmgr_flag)
{ {
struct sbi_instrument ins; struct sbi_instrument ins;
...@@ -833,7 +833,11 @@ static int opl3_load_patch(int dev, int format, const char *addr, ...@@ -833,7 +833,11 @@ static int opl3_load_patch(int dev, int format, const char *addr,
return -EINVAL; return -EINVAL;
} }
if(copy_from_user(&((char *) &ins)[offs], &(addr)[offs], sizeof(ins) - offs)) /*
* What the fuck is going on here? We leave junk in the beginning
* of ins and then check the field pretty close to that beginning?
*/
if(copy_from_user(&((char *) &ins)[offs], addr + offs, sizeof(ins) - offs))
return -EFAULT; return -EFAULT;
if (ins.channel < 0 || ins.channel >= SBFM_MAXINSTR) if (ins.channel < 0 || ins.channel >= SBFM_MAXINSTR)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment