From: Daniel Santos <danielfsantos@att.net>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Linus Walleij <linus.walleij@linaro.org>,
linux-gpio <linux-gpio@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] gpiolib: Fix crash when exporting non-existant gpio
Date: Sat, 24 Aug 2013 15:31:59 -0500 [thread overview]
Message-ID: <5219183F.8080300@att.net> (raw)
In-Reply-To: <52191041.7040505@roeck-us.net>
On 08/24/2013 02:57 PM, Guenter Roeck wrote:
>
> Looking into calling code, desc_to_gpio() is clearly not supposed to
> return an error,
> and it will result in odd behavior if it returns -1. For example, the
> resulting debug
> message of "gpio--1 (...) status ..." is not very useful.
>
> It would make more sense to fix the calling code. You could for example
> validate in affected functions if the gpio pin exists by not only
> checking for desc but also for desc->chip. Another option might be
> to have gpio_to_desc() return NULL if desc->chip is NULL.
Yes, you are correct of course. I guess I was just being lazy. :) I'll
re-submit.
next prev parent reply other threads:[~2013-08-24 20:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-24 18:48 [PATCH] gpiolib: Fix crash when exporting non-existant gpio danielfsantos
2013-08-24 19:57 ` Guenter Roeck
2013-08-24 20:31 ` Daniel Santos [this message]
2013-08-24 20:48 ` danielfsantos
2013-08-24 20:52 ` [PATCH v2] gpiolib: Fix crash when exporting non-existent gpio Daniel Santos
2013-08-24 21:51 ` [PATCH] gpiolib: Fix crash when exporting non-existant gpio Guenter Roeck
2013-08-29 9:52 ` Linus Walleij
2013-08-29 10:23 ` Alexandre Courbot
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=5219183F.8080300@att.net \
--to=danielfsantos@att.net \
--cc=daniel.santos@pobox.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
/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