Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75415df8 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

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: default avatarTakashi Iwai <tiwai@suse.de>
parent a8d09e3a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -46,8 +46,9 @@ static int snd_pcsp_create(struct snd_card *card)
	int err;
	int div, min_div, order;

	if (!nopcm) {
	hrtimer_get_res(CLOCK_MONOTONIC, &tp);

	if (!nopcm) {
		if (tp.tv_sec || tp.tv_nsec > PCSP_MAX_PERIOD_NS) {
			printk(KERN_ERR "PCSP: Timer resolution is not sufficient "
				"(%linS)\n", tp.tv_nsec);