[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <43293b8e-5b9d-ff51-aa3f-eb1a7b9490aa@canonical.com>
Date: Thu, 6 Sep 2018 13:01:58 +0100
From: Colin Ian King <colin.king@...onical.com>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: Fabio Estevam <fabio.estevam@....com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>, alsa-devel@...a-project.org,
kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ASoC: sgtl5000: avoid division by zero if lo_vag is zero
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@...onical.com>
>>
>> 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
>
Powered by blists - more mailing lists