mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Rui Miguel Silva <rmfrfs@gmail.com>
Cc: Mikhail Lobanov <m.lobanov@rosalinux.ru>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] greybus: Fix deref of NULL in __gb_lights_flash_brightness_set
Date: Mon, 4 Mar 2024 09:29:47 +0300	[thread overview]
Message-ID: <02f31119-e35a-4358-a0a0-079416ba4a9d@moroto.mountain> (raw)
In-Reply-To: <m3ttlolktk.fsf@gmail.com>

On Sat, Mar 02, 2024 at 03:23:03PM +0000, Rui Miguel Silva wrote:
> Dan Carpenter <dan.carpenter@linaro.org> writes:
> Hi Dan,
> 
> > On Fri, Mar 01, 2024 at 02:04:24PM -0500, Mikhail Lobanov wrote:
> >> Dereference of null pointer in the __gb_lights_flash_brightness_set function.
> >> Assigning the channel the result of executing the get_channel_from_mode function
> >> without checking for NULL may result in an error.
> >
> > get_channel_from_mode() can only return NULL when light->channels_count
> > is zero.
> >
> > Although get_channel_from_mode() seems buggy to me.  If it can't
> > find the correct mode, it just returns the last channel.  So potentially
> > it should be made to return NULL.
> 
> Correct, thanks for the fix. Will you or me send a proper patch for
> this? Taking also the suggestion from Alex.

I'll send it.  Thanks!

regards,
dan carpenter


  reply	other threads:[~2024-03-04  6:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01 19:04 Mikhail Lobanov
2024-03-02  9:59 ` Dan Carpenter
2024-03-02 14:57   ` [greybus-dev] " Alex Elder
2024-03-02 15:21     ` Rui Miguel Silva
2024-03-02 15:23   ` Rui Miguel Silva
2024-03-04  6:29     ` Dan Carpenter [this message]
2024-03-02 15:18 ` Rui Miguel Silva
2024-03-02 15:31 ` [greybus-dev] " Alex Elder
2024-03-02 16:35   ` Rui Miguel Silva
2024-03-04 13:30     ` Alex Elder
2024-03-04 13:30   ` Alex Elder
2024-03-06  9:21 ` Rui Miguel Silva
2024-03-06 15:29   ` Михаил Лобанов

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=02f31119-e35a-4358-a0a0-079416ba4a9d@moroto.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=greybus-dev@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=m.lobanov@rosalinux.ru \
    --cc=rmfrfs@gmail.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®