public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: patrick.rudolph@9elements.com
Cc: linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Alexios Zavras <alexios.zavras@intel.com>,
	Allison Randal <allison@lohutok.net>,
	Stephen Boyd <swboyd@chromium.org>,
	Julius Werner <jwerner@chromium.org>,
	Samuel Holland <samuel@sholland.org>
Subject: Re: [PATCH 1/2] firmware: google: Expose CBMEM over sysfs
Date: Wed, 20 Nov 2019 15:02:11 +0100	[thread overview]
Message-ID: <20191120140211.GA2935300@kroah.com> (raw)
In-Reply-To: <20191120133958.13160-2-patrick.rudolph@9elements.com>

On Wed, Nov 20, 2019 at 02:39:46PM +0100, patrick.rudolph@9elements.com wrote:
> +static int cbmem_probe(struct coreboot_device *cdev)
> +{
> +	struct device *dev = &cdev->dev;
> +	struct cb_priv *priv;
> +	int err;
> +
> +	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
> +	if (!priv)
> +		return -ENOMEM;
> +
> +	memcpy(&priv->entry, &cdev->cbmem_entry, sizeof(priv->entry));
> +
> +	priv->remap = memremap(priv->entry.address,
> +			       priv->entry.entry_size, MEMREMAP_WB);
> +	if (!priv->remap) {
> +		err = -ENOMEM;
> +		goto failure;
> +	}
> +
> +	err = sysfs_create_group(&dev->kobj, &cb_mem_attr_group);

Ick, you just raced userspace and lost :(

Please set the default group for the driver (dev_groups), so that the
driver core will correctly create and remove this group without you
having to do anything.

thanks,

greg k-h

  reply	other threads:[~2019-11-20 14:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-20 13:39 [PATCH 0/2] firmware: google: Expose coreboot tables and CBMEM patrick.rudolph
2019-11-20 13:39 ` [PATCH 1/2] firmware: google: Expose CBMEM over sysfs patrick.rudolph
2019-11-20 14:02   ` Greg Kroah-Hartman [this message]
2019-11-20 13:39 ` [PATCH 2/2] firmware: google: Expose coreboot tables " patrick.rudolph
2019-11-20 14:03   ` Greg Kroah-Hartman
2019-11-20 14:02 ` [PATCH 0/2] firmware: google: Expose coreboot tables and CBMEM Greg Kroah-Hartman
  -- strict thread matches above, loose matches on Subject: below --
2019-11-15 16:15 patrick.rudolph
2019-11-15 16:15 ` [PATCH 1/2] firmware: google: Expose CBMEM over sysfs patrick.rudolph
2019-11-16 13:36   ` Greg Kroah-Hartman
2019-11-17  1:18   ` kbuild test robot

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=20191120140211.GA2935300@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=alexios.zavras@intel.com \
    --cc=allison@lohutok.net \
    --cc=jwerner@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patrick.rudolph@9elements.com \
    --cc=samuel@sholland.org \
    --cc=swboyd@chromium.org \
    --cc=tglx@linutronix.de \
    /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