mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Kishon Vijay Abraham I <kishon@ti.com>
Cc: lrg@ti.com, balbi@ti.com, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] drivers: regulator: add error checks for exported APIs
Date: Thu, 26 Jul 2012 12:10:30 +0100	[thread overview]
Message-ID: <20120726111030.GU3099@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1343298603-25442-1-git-send-email-kishon@ti.com>

[-- Attachment #1: Type: text/plain, Size: 923 bytes --]

On Thu, Jul 26, 2012 at 04:00:03PM +0530, Kishon Vijay Abraham I wrote:

> Added error checks for exported APIs in regulator framework so that
> incorrect use of these APIs does not result in a crash.

The commit (especially the subject) should be more descriptive, it's not
that we're missing error checks it's that you're handling garbage passed
in from the user a bit more gracefully.

I'm not sure how useful this is as-is -  if you're not checking your
errors you're not checking your errors so it's probably just pushing the
robustness failures around, especially since...

> +	if (IS_ERR_OR_NULL(regulator))
> +		return -ENODEV;

...this is too quiet, this should at the very least be generating a loud
warning so people can see there's a problem (probably with WARN_ON so we
can see what called it).  Can you respin with something noisier please?

Also NULL is a valid regulator (though we don't use it right now).

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-07-26 11:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-26 10:30 Kishon Vijay Abraham I
2012-07-26 11:10 ` Mark Brown [this message]
2012-07-26 11:19   ` ABRAHAM, KISHON VIJAY
2012-07-26 11:22     ` Mark Brown
2012-07-26 11:23       ` ABRAHAM, KISHON VIJAY

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=20120726111030.GU3099@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=balbi@ti.com \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@ti.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

all inboxes | Powered by JetHome®