All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	Luka Perkov <luka.perkov@sartura.hr>,
	Robert Marko <robert.marko@sartura.hr>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] nvmem: core: Expose cells through sysfs
Date: Thu, 1 Jun 2023 11:26:28 +0200	[thread overview]
Message-ID: <20230601112628.7d2dc77f@xps-13> (raw)
In-Reply-To: <2023060142-thyself-flatware-26f7@gregkh>

Hi Greg,

gregkh@linuxfoundation.org wrote on Thu, 1 Jun 2023 10:03:01 +0100:

> On Thu, Jun 01, 2023 at 10:51:14AM +0200, Miquel Raynal wrote:
> > > > +	/* Without exposed cells, successfully exit after
> > > > assigning an empty attributes array */
> > > > +	if (!ncells)
> > > > +		goto unlock_mutex;  
> > > 
> > > Shouldn't this check be higher up _before_ you allocate any memory?
> > > If the attribute group list is empty, nothing should be created,
> > > right?  Or will the driver core crash?
> > 
> > As you rightfully guessed it, the core will crash if no list is
> > provided at all. I need to provide an empty list with just an empty
> > member and everything goes smoothly. 
> 
> Let's fix the core, it shouldn't crash like that :)

Perfectly fine by me, I'll give this idea a try.

Thanks,
Miquèl

      reply	other threads:[~2023-06-01  9:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-30 10:09 [PATCH v2 0/2] NVMEM cells in sysfs Miquel Raynal
2023-05-30 10:09 ` [PATCH v2 1/2] ABI: sysfs-nvmem-cells: Expose cells through sysfs Miquel Raynal
2023-05-30 10:09 ` [PATCH v2 2/2] nvmem: core: " Miquel Raynal
     [not found]   ` <2023053132-divorcee-aqueduct-70fa@gregkh>
2023-06-01  8:51     ` Miquel Raynal
2023-06-01  9:03       ` Greg Kroah-Hartman
2023-06-01  9:26         ` Miquel Raynal [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=20230601112628.7d2dc77f@xps-13 \
    --to=miquel.raynal@bootlin.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luka.perkov@sartura.hr \
    --cc=robert.marko@sartura.hr \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=thomas.petazzoni@bootlin.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.