Linux Input/HID development
 help / color / mirror / Atom feed
From: Ferruh Yigit <fery@cypress.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Javier Martinez Canillas <javier@dowhile0.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-input@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch 2/3] Input: cyttsp4 - silence NULL dereference warning
Date: Wed, 3 Jul 2013 15:33:19 +0300	[thread overview]
Message-ID: <51D41A0F.80008@cypress.com> (raw)
In-Reply-To: <20130702214107.GB1598@elgon.mountain>

On 07/03/2013 12:41 AM, Dan Carpenter wrote:
> If "cd" were NULL then we would dereference it when we print the error
> message.  Fortunately enough, it can't ever be NULL so we can remove
> those lines.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/input/touchscreen/cyttsp4_core.c b/drivers/input/touchscreen/cyttsp4_core.c
> index 7aa4a34..851e3ff 100644
> --- a/drivers/input/touchscreen/cyttsp4_core.c
> +++ b/drivers/input/touchscreen/cyttsp4_core.c
> @@ -1450,11 +1450,6 @@ static void cyttsp4_watchdog_work(struct work_struct *work)
>       u8 *mode;
>       int retval;
>
> -     if (cd == NULL) {
> -             dev_err(cd->dev, "%s: NULL context pointer\n", __func__);
> -             return;
> -     }
> -
>       mutex_lock(&cd->system_lock);
>       retval = cyttsp4_load_status_regs(cd);
>       if (retval < 0) {
You are right, cd dereference is wrong in error message.
And agree on removing block, cd will not be NULL in this context.

--

Thanks,
ferruh

This message and any attachments may contain Cypress (or its subsidiaries) confidential information. If it has been received in error, please advise the sender and immediately delete this message.

      reply	other threads:[~2013-07-03 12:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-02 21:41 [patch 2/3] Input: cyttsp4 - silence NULL dereference warning Dan Carpenter
2013-07-03 12:33 ` Ferruh Yigit [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=51D41A0F.80008@cypress.com \
    --to=fery@cypress.com \
    --cc=dan.carpenter@oracle.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=javier@dowhile0.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    /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