Commit 9e9540b8 authored by Adrian Bunk's avatar Adrian Bunk Committed by David S. Miller

mISDN/dsp_cmx.c: fix size checks

The checks for ensuring that the array indices are inside the range
were flipped.
Reported-by: default avatarAdrian Bunk <bunk@kernel.org>
Signed-off-by: default avatarAdrian Bunk <bunk@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6bff338b
...@@ -452,10 +452,10 @@ dsp_cmx_hardware(struct dsp_conf *conf, struct dsp *dsp) ...@@ -452,10 +452,10 @@ dsp_cmx_hardware(struct dsp_conf *conf, struct dsp *dsp)
if (finddsp->features.pcm_id == dsp->features.pcm_id) { if (finddsp->features.pcm_id == dsp->features.pcm_id) {
if (finddsp->pcm_slot_rx >= 0 && if (finddsp->pcm_slot_rx >= 0 &&
finddsp->pcm_slot_rx < sizeof(freeslots)) finddsp->pcm_slot_rx < sizeof(freeslots))
freeslots[finddsp->pcm_slot_tx] = 0; freeslots[finddsp->pcm_slot_rx] = 0;
if (finddsp->pcm_slot_tx >= 0 && if (finddsp->pcm_slot_tx >= 0 &&
finddsp->pcm_slot_tx < sizeof(freeslots)) finddsp->pcm_slot_tx < sizeof(freeslots))
freeslots[finddsp->pcm_slot_rx] = 0; freeslots[finddsp->pcm_slot_tx] = 0;
} }
} }
i = 0; i = 0;
......
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