diff options
Diffstat (limited to 'sound/pci/hda/patch_ca0132.c')
-rw-r--r-- | sound/pci/hda/patch_ca0132.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c index db02c1e96b08..eefc4563b2f9 100644 --- a/sound/pci/hda/patch_ca0132.c +++ b/sound/pci/hda/patch_ca0132.c | |||
@@ -2298,6 +2298,11 @@ static int dspxfr_one_seg(struct hda_codec *codec, | |||
2298 | hda_frame_size_words = ((sample_rate_div == 0) ? 0 : | 2298 | hda_frame_size_words = ((sample_rate_div == 0) ? 0 : |
2299 | (num_chans * sample_rate_mul / sample_rate_div)); | 2299 | (num_chans * sample_rate_mul / sample_rate_div)); |
2300 | 2300 | ||
2301 | if (hda_frame_size_words == 0) { | ||
2302 | snd_printdd(KERN_ERR "frmsz zero\n"); | ||
2303 | return -EINVAL; | ||
2304 | } | ||
2305 | |||
2301 | buffer_size_words = min(buffer_size_words, | 2306 | buffer_size_words = min(buffer_size_words, |
2302 | (unsigned int)(UC_RANGE(chip_addx, 1) ? | 2307 | (unsigned int)(UC_RANGE(chip_addx, 1) ? |
2303 | 65536 : 32768)); | 2308 | 65536 : 32768)); |
@@ -2308,8 +2313,7 @@ static int dspxfr_one_seg(struct hda_codec *codec, | |||
2308 | chip_addx, hda_frame_size_words, num_chans, | 2313 | chip_addx, hda_frame_size_words, num_chans, |
2309 | sample_rate_mul, sample_rate_div, buffer_size_words); | 2314 | sample_rate_mul, sample_rate_div, buffer_size_words); |
2310 | 2315 | ||
2311 | if ((buffer_addx == NULL) || (hda_frame_size_words == 0) || | 2316 | if (buffer_size_words < hda_frame_size_words) { |
2312 | (buffer_size_words < hda_frame_size_words)) { | ||
2313 | snd_printdd(KERN_ERR "dspxfr_one_seg:failed\n"); | 2317 | snd_printdd(KERN_ERR "dspxfr_one_seg:failed\n"); |
2314 | return -EINVAL; | 2318 | return -EINVAL; |
2315 | } | 2319 | } |