Re: [PATCH] ASoC: sgtl5000: avoid division by zero if lo_vag is zero

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

 



On 06/09/18 12:58, Dan Carpenter wrote:
> On Thu, Sep 06, 2018 at 11:41:52AM +0100, Colin King wrote:
>> From: Colin Ian King <colin.king@xxxxxxxxxxxxx>
>>
>> In the case where lo_vag <= SGTL5000_LINE_OUT_GND_BASE, lo_vag
>> is set to zero and later vol_quot is computed by dividing by
>> lo_vag causing a division by zero error.  Fix this by avoiding
>> a zero division and set vol_quot to zero in this specific case
>> so that the lowest setting for i is correctly set.
>>
> 
> This is a very clever patch.  How did you find the bug?

trawling through a lot of false positives from a recent cppcheck run

> 
> 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]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux