All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Brannon <chris@the-brannons.com>
To: "Raphael S.Carvalho" <raphael.scarv@gmail.com>
Cc: William Hubbs <w.d.hubbs@gmail.com>,
	Kirk Reiser <kirk@reisers.ca>,
	Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	speakup@braille.uwo.ca, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] staging/speakup/kobjects.c: Code improvement.
Date: Sun, 08 Sep 2013 20:56:43 -0700	[thread overview]
Message-ID: <87fvtefy10.fsf@mushroom.PK5001Z> (raw)
In-Reply-To: <1378160418-13898-1-git-send-email-raphael.scarv@gmail.com> (Raphael S. Carvalho's message of "Mon, 2 Sep 2013 19:20:18 -0300")

"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

  reply	other threads:[~2013-09-09  4:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-02 22:20 [PATCH 1/1] staging/speakup/kobjects.c: Code improvement Raphael S.Carvalho
2013-09-09  3:56 ` Chris Brannon [this message]
     [not found]   ` <CACz=WeeE+jxdaxpR_amF60deDcEy8nChYYfY3UA3CNfhmOB8Gw@mail.gmail.com>
2013-09-09  4:16     ` Fwd: " Raphael S Carvalho
2013-09-09  6:02     ` Chris Brannon
2013-09-10 23:12       ` Dan Carpenter
2013-09-11  1:29         ` Chris Brannon
2013-09-11  7:59           ` Dan Carpenter
2013-09-11 21:01 ` Samuel Thibault
  -- strict thread matches above, loose matches on Subject: below --
2013-06-22  1:54 Raphael S. Carvalho
2013-06-30  8:11 ` Samuel Thibault
2013-07-23 21:39 ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fvtefy10.fsf@mushroom.PK5001Z \
    --to=chris@the-brannons.com \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kirk@reisers.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=raphael.scarv@gmail.com \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=speakup@braille.uwo.ca \
    --cc=w.d.hubbs@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.