public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Miquel Raynal <miquel.raynal@bootlin.com>
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 10:03:01 +0100	[thread overview]
Message-ID: <2023060142-thyself-flatware-26f7@gregkh> (raw)
In-Reply-To: <20230601105114.58749075@xps-13>

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 :)

thanks,

greg k-h

  reply	other threads:[~2023-06-01  9:04 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 [this message]
2023-06-01  9:26         ` Miquel Raynal

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=2023060142-thyself-flatware-26f7@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luka.perkov@sartura.hr \
    --cc=miquel.raynal@bootlin.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox