bug report: aloop: potential signedness bug in loopback_prepare()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jaroslav,

sound/drivers/aloop.c +287 loopback_prepare(10)
	warn: bogus compare against zero: 'bps'
   282          unsigned int bps, salign;
   283
   284          salign = (snd_pcm_format_width(runtime->format) *
   285							runtime->channels) / 8;
   286          bps = salign * runtime->rate;
   287          if (bps <= 0 || salign <= 0)
                    ^^^^^^^^^^^^^^^^^^^^^^^

	Both "bps" and "salign" are unsigned and are never less than
	zero.  Should this just be checking for == 0?  Or was the check
	supposed to catch integer overflows?

   288                  return -EINVAL;
   289

regards,
dan carpenter
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel


[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux