lkml.org 
[lkml]   [2013]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 1/1] staging/speakup/kobjects.c: Code improvement.
Date
"Raphael S.Carvalho" <raphael.scarv@gmail.com> writes:

> + /*
> + * If voice was just changed, we might need to reset our default
> + * pitch and volume.
> + */
> + if (param->var_id == VOICE) {
> + spk_reset_default_value("pitch", synth->default_pitch,
> + value);
> + spk_reset_default_value("vol", synth->default_vol,
> + value);

There's an "invalid read" bug here. You didn't introduce it; it has
been there all along. It's possible that value contains a value that is
out of range, in which case, the spk_reset_default_value calls could
fetch invalid data. The value of ret should be sufficient for
determining whether value is in range, so I'd change the condition of
the if statement to this:

if (param->var_id == VOICE && ret != -ERANGE) {

Or possibly better:
if (param->var_id == VOICE && ret == 0) {

I'd say please resend with that fix, or if not, I can send a one-line
patch to be applied after yours.

-- Chris


\
 
 \ /
  Last update: 2013-09-09 06:21    [W:0.051 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site