From: James Courtier-Dutton <James@superbug.co.uk>
To: Jaroslav Kysela <perex@users.sourceforge.net>
Cc: Alsa-devel@lists.sourceforge.net
Subject: Re: [alsa-cvslog] CVS: alsa-kernel/pci/emu10k1 emufx.c,1.59,1.60
Date: Sun, 07 Nov 2004 18:11:26 +0000 [thread overview]
Message-ID: <418E654E.5000807@superbug.co.uk> (raw)
In-Reply-To: <E1CNAGJ-000270-L7@sc8-pr-cvs1.sourceforge.net>
Jaroslav Kysela wrote:
> Update of /cvsroot/alsa/alsa-kernel/pci/emu10k1
> In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7704/pci/emu10k1
>
> Modified Files:
> emufx.c
> Log Message:
> Summary: fixed emu10k1_fx8010_code_t structure to be less than 8192 bytes
>
> This patch fixes emu10k1_fx8010_code_t structure using indirect pointers
> to be less than 8192 bytes to follow the ioctl semantics.
>
>
>
> -static void snd_emu10k1_audigy_write_op(emu10k1_fx8010_code_t *icode, unsigned int *ptr,
> - u32 op, u32 r, u32 a, u32 x, u32 y)
> +static int snd_emu10k1_audigy_write_op(emu10k1_fx8010_code_t *icode, unsigned int *ptr,
> + u32 op, u32 r, u32 a, u32 x, u32 y)
> {
> snd_assert(*ptr < 1024, return);
> set_bit(*ptr, icode->code_valid);
> - icode->code[*ptr ][0] = ((x & 0x7ff) << 12) | (y & 0x7ff);
> - icode->code[(*ptr)++][1] = ((op & 0x0f) << 24) | ((r & 0x7ff) << 12) | (a & 0x7ff);
> + x = ((x & 0x7ff) << 12) | (y & 0x7ff);
> + y = ((op & 0x0f) << 24) | ((r & 0x7ff) << 12) | (a & 0x7ff);
> + a = *ptr++ * 2;
> + if (put_user(x, &icode->code[a + 0]) ||
> + put_user(y, &icode->code[a + 1]))
> + return -EFAULT;
> + return 0;
> }
>
> #define A_OP(icode, ptr, op, r, a, x, y) \
> @@ -501,83 +511,108 @@
This code breaks Audigy 1/2 support.
1)
+ a = *ptr++ * 2;
should be
+ a = (*ptr)++ * 2;
We want the integer to increase, not the pointer to the integer.
That bug causes the snd-emu10k1 driver to hang during modprobe.
2)
> + if (put_user(x, &icode->code[a + 0]) ||
> + put_user(y, &icode->code[a + 1]))
> + return -EFAULT;
Will always return -EFAULT on my system. I don't think that is what we
really want.
James
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
next parent reply other threads:[~2004-11-07 18:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E1CNAGJ-000270-L7@sc8-pr-cvs1.sourceforge.net>
2004-11-07 18:11 ` James Courtier-Dutton [this message]
2004-11-08 6:39 ` [alsa-cvslog] CVS: alsa-kernel/pci/emu10k1 emufx.c,1.59,1.60 Jaroslav Kysela
2004-11-09 0:12 ` James Courtier-Dutton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=418E654E.5000807@superbug.co.uk \
--to=james@superbug.co.uk \
--cc=Alsa-devel@lists.sourceforge.net \
--cc=perex@users.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox