Skip to content

Commit 75415df

Browse files
committed
ALSA: pcsp: Fix initialization with nopcm=1
When nopcm=1 is set, some initializations based on hrtimer resolution might be bogus because the driver checks the resolution only when nopcm=0. Simply get the resolution always at first for fixing the bug. Spotted by coverity CID 139740. Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent a8d09e3 commit 75415df

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎sound/drivers/pcsp/pcsp.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ static int snd_pcsp_create(struct snd_card *card)
4646
int err;
4747
int div, min_div, order;
4848

49+
hrtimer_get_res(CLOCK_MONOTONIC, &tp);
50+
4951
if (!nopcm) {
50-
hrtimer_get_res(CLOCK_MONOTONIC, &tp);
5152
if (tp.tv_sec || tp.tv_nsec > PCSP_MAX_PERIOD_NS) {
5253
printk(KERN_ERR "PCSP: Timer resolution is not sufficient "
5354
"(%linS)\n", tp.tv_nsec);

0 commit comments

Comments
 (0)