linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Steven Liu <lingjiujianke@gmail.com>
Cc: jy0922.shim@samsung.com, linux-kernel@vger.kernel.org,
	linux-input@vger.kernel.org, liuqi@thunderst.com
Subject: Re: [PATCH] touchscreen: check kzalloc memory for data first
Date: Wed, 11 May 2011 14:12:38 -0700	[thread overview]
Message-ID: <20110511211238.GA11178@core.coreip.homeip.net> (raw)
In-Reply-To: <BANLkTi=yWrPiz9Wp0H46at4NVfMSJ8n1uw@mail.gmail.com>

Hi Steven,

On Wed, May 11, 2011 at 10:23:16AM +0800, Steven Liu wrote:
> Hi Joonyoung Shim ,
> 
>             Can this patch be fixed in?
> 
> 
> if kzalloc memroy for data was faild, it will multi free data
> memory space. so check the data memory first, is it kzalloc faild
> for data, it should goto end and do nothing.

There is no double-free as both kfree() and input_free_device() know to
ignore NULL pointers and we ensure that both pointers to be initialized
(either point to allocated memory or be NULL). We do not expect either
of the memory allocations to fail so instead of handling failures
separately they are handled both at once.

Thanks.

-- 
Dmitry

      parent reply	other threads:[~2011-05-11 21:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-11  2:23 [PATCH] touchscreen: check kzalloc memory for data first Steven Liu
2011-05-11  2:45 ` Steven Liu
2011-05-11  3:03 ` Joonyoung Shim
2011-05-11 21:12 ` 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=20110511211238.GA11178@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=jy0922.shim@samsung.com \
    --cc=lingjiujianke@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuqi@thunderst.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 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).