aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-03-05 06:13:10 -0500
committerTakashi Iwai <tiwai@suse.de>2014-03-05 06:15:56 -0500
commit4913cd6964d9548d8636ac87e05b7db6c486add5 (patch)
treed4aecf950338eacd756757cfca504488f3e86001 /sound/pci
parent4f50b41fa3deb541364462f3014e0b9d09b91f75 (diff)
ALSA: emu10k1: Fix possible NULL dereference
The previous dev_err() conversion resulted in a code that may give NULL dereference in snd_emu10k1_ptr_write(). Since it's a sanity check, better to be replaced with a debug macro like other places in this driver. Fixes: 6f002b02166c ('ALSA: emu10k1: Use standard printk helpers') Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/emu10k1/io.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sound/pci/emu10k1/io.c b/sound/pci/emu10k1/io.c
index 81c75b4528d9..706b4f0c6806 100644
--- a/sound/pci/emu10k1/io.c
+++ b/sound/pci/emu10k1/io.c
@@ -71,11 +71,8 @@ void snd_emu10k1_ptr_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned i
71 unsigned long flags; 71 unsigned long flags;
72 unsigned int mask; 72 unsigned int mask;
73 73
74 if (!emu) { 74 if (snd_BUG_ON(!emu))
75 dev_err(emu->card->dev, "ptr_write: emu is null!\n");
76 dump_stack();
77 return; 75 return;
78 }
79 mask = emu->audigy ? A_PTR_ADDRESS_MASK : PTR_ADDRESS_MASK; 76 mask = emu->audigy ? A_PTR_ADDRESS_MASK : PTR_ADDRESS_MASK;
80 regptr = ((reg << 16) & mask) | (chn & PTR_CHANNELNUM_MASK); 77 regptr = ((reg << 16) & mask) | (chn & PTR_CHANNELNUM_MASK);
81 78