mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] [PATCH] gpiolib: Fix Oops in gpiod_direction_input_nonotify()
Date: Fri, 28 Feb 2025 16:04:11 +0300	[thread overview]
Message-ID: <084aad2a-83ae-4027-a934-797f53962256@stanley.mountain> (raw)
In-Reply-To: <CAMRc=MeF42NeNJ_kR7H7oJsCHt=grTtN=c-3RbjFhX=uRQ5X9w@mail.gmail.com>

On Fri, Feb 28, 2025 at 12:06:24PM +0100, Bartosz Golaszewski wrote:
> On Thu, Feb 27, 2025 at 9:17 AM Dan Carpenter <dan.carpenter@linaro.org> wrote:
> >
> > The gpiod_direction_input_nonotify() function is supposed to return zero
> > if the direction for the pin is input.  But instead it accidentally
> > returns GPIO_LINE_DIRECTION_IN (1) which will be cast into an ERR_PTR()
> > in gpiochip_request_own_desc().  The callers dereference it and it leads
> > to a crash.
> >
> > I changed gpiod_direction_output_raw_commit() just for consistency but
> > returning GPIO_LINE_DIRECTION_OUT (0) is fine.
> >
> > Cc: stable@vger.kernel.org
> > Fixes: 9d846b1aebbe ("gpiolib: check the return value of gpio_chip::get_direction()")
> > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> > ---
> 
> This doesn't apply on top of v6.14-rc4, could you please rebase and
> resend? Thanks for the catch!

Sure, of course.

regards,
dan carpenter


      reply	other threads:[~2025-02-28 13:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-27  8:17 Dan Carpenter
2025-02-28 11:06 ` Bartosz Golaszewski
2025-02-28 13:04   ` Dan Carpenter [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=084aad2a-83ae-4027-a934-797f53962256@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=brgl@bgdev.pl \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®