linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Yizhuo Zhai <yzhai003@ucr.edu>
Cc: linux-input@vger.kernel.org, Chengyu Song <csong@cs.ucr.edu>,
	Zhiyun Qian <zhiyunq@cs.ucr.edu>
Subject: Re: Potential uninitialized variables in subsys input: bcm_iproc_tsc
Date: Thu, 3 Oct 2019 15:42:32 -0700	[thread overview]
Message-ID: <20191003224232.GE22365@dtor-ws> (raw)
In-Reply-To: <CABvMjLR1FmKNWrvsFF1x24iv218+Px-HUfmRyt7CtqfhZxOgyA@mail.gmail.com>

Hi Yizhuo,

On Thu, Oct 03, 2019 at 01:29:05PM -0700, Yizhuo Zhai wrote:
> Hi Dmitry:
> 
> Variable "intr_status" and "raw_coordinate" in function
> iproc_touchscreen_interrupt()(
> (drivers/input/touchscreen/bcm_iproc_tsc.c) could be uninitialized if
> regmap_read() returns -EINVAL. But it's directly used later without
> the return check, which is potentially unsafe.
> 
> Also, we cannot simply return -EINVAL in iproc_touchscreen_interrupt()
> because it is out of the return type: irqreturn_t. The same cases
> happen in function  mx25_tcq_irq() with variable "stat" and function
> mx25_tcq_init() with variable "tgcr".
> 
> Thanks for your time to check this case.

Both of these drivers use MMIO to interact with the hardware, so regmap
failing is purely theoretical possibility.

Thanks.

-- 
Dmitry

      reply	other threads:[~2019-10-03 22:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-03 20:29 Potential uninitialized variables in subsys input: bcm_iproc_tsc Yizhuo Zhai
2019-10-03 22:42 ` Dmitry Torokhov [this message]

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=20191003224232.GE22365@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=csong@cs.ucr.edu \
    --cc=linux-input@vger.kernel.org \
    --cc=yzhai003@ucr.edu \
    --cc=zhiyunq@cs.ucr.edu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).