Skip to content

Commit

Permalink
ALSA: hda - Fix the previous sanity check in make_codec_cmd()
Browse files Browse the repository at this point in the history
The newly added sanity-check for a codec verb can be better written
with logical ORs.  Also, the parameter can be more than 8bit.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Jul 17, 2009
1 parent 6430aee commit 82e1b80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ make_codec_cmd(struct hda_codec *codec, hda_nid_t nid, int direct,
{
u32 val;

if ((codec->addr & ~0xf) | (direct & ~1) | (nid & ~0x7f) |
(verb & ~0xfff) | (parm & ~0xff)) {
if ((codec->addr & ~0xf) || (direct & ~1) || (nid & ~0x7f) ||
(verb & ~0xfff) || (parm & ~0xffff)) {
printk(KERN_ERR "hda-codec: out of range cmd %x:%x:%x:%x:%x\n",
codec->addr, direct, nid, verb, parm);
return ~0;
Expand Down

0 comments on commit 82e1b80

Please sign in to comment.