public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: "andrzej zaborowski" <balrogg@gmail.com>
To: me@felipebalbi.com
Cc: felipe.balbi@nokia.com, linux-omap@vger.kernel.org,
	Tony Lindgren <tony@atomide.com>,
	Eduardo Valentin <edubezval@gmail.com>,
	Daniel Stone <daniel.stone@nokia.com>
Subject: Re: [PATCH 1/5] I2C: LM8323: Introduce lm8323 keypad driver
Date: Thu, 10 Apr 2008 15:18:33 +0200	[thread overview]
Message-ID: <fb249edb0804100618x61c3d47dwf9bca3ad8ee2dbc3@mail.gmail.com> (raw)
In-Reply-To: <20080409180557.GA15913@kedavra.cpe.vivax.com.br>

On 09/04/2008, Felipe Balbi <me@felipebalbi.com> wrote:
> On Wed, Apr 09, 2008 at 07:26:31PM +0200, andrzej zaborowski wrote:
>  [...]
>
>  > >  +       time = strict_strtoul(buf, 10, &res);
>  > >  +       /* Numbers only, please. */
>  > >  +       if (buf && *buf != '\n' && *(buf + 1) != '\0')
>  > >  +               return -EINVAL;
>  >
>  > The condition doesn't look correct, for example it rejects "55\n\0"
>  > but accepts NULL.
>
>
> Well, this is not my driver and i just moved to strict_stroul cuz
>  checkpatch asked me to. I'll take a closer look tomorrow but if you can
>  come up with a better solution for this, I'll ack.

Turns out the result is returned in the buffer in third parameter, and
the checking is already "strict" (rejects trailing non-numbers), so
this should look something like:

ret = strict_strtoul(buf, 0, &time);
if (ret)
        return ret;

>
>  btw, good catch, i didn't had too much time to work on this but still
>  the driver is working fine.
>
>
>  > >  +       i2c_set_clientdata(client, lm);
>  > >  +       lm->client = client;
>  > >  +       lm8323_pdata = client->dev.platform_data;
>  > >  +       if (!lm8323_pdata)
>  > >  +               return -EINVAL; /* ? */
>  >
>  > Here lm remains allocated and is lost.  Not that it bothers me, but
>  > probably not what was intended.
>
>
> You mean the error handling?

Yep.

>
>  if (!lm8323_pdata) {
>         kfree(lm);
>         return -EINVAL;
>  }
>
>  fixing tomorrow.

Thanks
-- 
Please do not print this email unless absolutely necessary. Spread
environmental awareness.

  parent reply	other threads:[~2008-04-10 13:18 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-09 12:03 [PATCH 0/5] n810 drivers, take #3 Felipe Balbi
2008-04-09 12:04 ` [PATCH 1/5] I2C: LM8323: Introduce lm8323 keypad driver Felipe Balbi
2008-04-09 12:04   ` [PATCH 2/5] I2C: TSL2563: Add support for Taos tsl2563 ambient light sensor Felipe Balbi
2008-04-09 12:04     ` [PATCH 3/5] INPUT: TOUCHSCREEN: Introduce tsc2005 driver Felipe Balbi
2008-04-09 12:04       ` [PATCH 4/5] I2C: LP5521: Introduce lp5521 LED driver Felipe Balbi
2008-04-09 12:04         ` [PATCH 5/5] ARM: N800: Update n800 defconfig Felipe Balbi
2008-04-09 12:11   ` [PATCH 1/5] I2C: LM8323: Introduce lm8323 keypad driver Felipe Balbi
2008-04-09 17:26     ` andrzej zaborowski
2008-04-09 18:05       ` Felipe Balbi
2008-04-09 18:28         ` Lauri Leukkunen
2008-04-09 23:58           ` andrzej zaborowski
2008-04-10  0:12             ` Daniel Stone
2008-04-10  1:12               ` andrzej zaborowski
2008-04-14 18:02                 ` Tony Lindgren
2008-04-09 20:35         ` Daniel Stone
2008-04-10 13:18         ` andrzej zaborowski [this message]
2008-04-10 14:34           ` Felipe Balbi
2008-04-14 18:03 ` [PATCH 0/5] n810 drivers, take #3 Tony Lindgren
  -- strict thread matches above, loose matches on Subject: below --
2008-04-09 10:09 [PATCH 0/5] resend n810 drivers Felipe Balbi
2008-04-09 10:09 ` [PATCH 1/5] I2C: LM8323: Introduce lm8323 keypad driver Felipe Balbi
2008-04-09 10:54   ` Eduardo Valentin
2008-04-09 11:02     ` Daniel Stone
2008-04-09 11:33       ` Eduardo Valentin
2008-04-09 10:04 [PATCH 0/5] n810 drivers Felipe Balbi
2008-04-09 10:04 ` [PATCH 1/5] I2C: LM8323: Introduce lm8323 keypad driver Felipe Balbi

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=fb249edb0804100618x61c3d47dwf9bca3ad8ee2dbc3@mail.gmail.com \
    --to=balrogg@gmail.com \
    --cc=daniel.stone@nokia.com \
    --cc=edubezval@gmail.com \
    --cc=felipe.balbi@nokia.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=me@felipebalbi.com \
    --cc=tony@atomide.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