From: "Elliott, Robert (Servers)" <elliott@hpe.com>
To: Aapo Vienamo <aapo.vienamo@linux.intel.com>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
"Andy Shevchenko" <andy@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: RE: [PATCH] gpio: Add Intel Granite Rapids-D vGPIO driver
Date: Fri, 19 Apr 2024 19:59:48 +0000 [thread overview]
Message-ID: <MW5PR84MB1842F4C102CBFA73E861F420AB0D2@MW5PR84MB1842.NAMPRD84.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20240419080555.97343-1-aapo.vienamo@linux.intel.com>
> -----Original Message-----
> From: Aapo Vienamo <aapo.vienamo@linux.intel.com>
> Sent: Friday, April 19, 2024 3:06 AM
> Subject: [PATCH] gpio: Add Intel Granite Rapids-D vGPIO driver
>
...
> +static int gnr_gpio_probe(struct platform_device *pdev)
> +{
> + size_t num_backup_pins = IS_ENABLED(CONFIG_PM_SLEEP) ? GNR_NUM_PINS
> : 0;
> + struct device *dev = &pdev->dev;
> + struct gpio_irq_chip *girq;
> + struct gnr_gpio *priv;
> + void __iomem *regs;
> + int irq, ret;
> +
> + priv = devm_kzalloc(dev, struct_size(priv, pad_backup,
> num_backup_pins), GFP_KERNEL);
> + if (!priv)
> + return -ENOMEM;
> +
> + regs = devm_platform_ioremap_resource(pdev, 0);
> + if (IS_ERR(regs))
> + return PTR_ERR(regs);
> +
> + irq = platform_get_irq(pdev, 0);
> + if (irq < 0)
> + return irq;
> +
> + ret = devm_request_irq(dev, irq, gnr_gpio_irq, IRQF_SHARED |
> IRQF_NO_THREAD,
> + dev_name(dev), priv);
> + if (ret)
> + return dev_err_probe(dev, ret, "failed to request interrupt\n");
All of these early returns will leave the memory allocated to priv
forever, since priv isn't saved anywhere until:
> + platform_set_drvdata(pdev, priv);
next prev parent reply other threads:[~2024-04-19 20:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-19 8:05 Aapo Vienamo
2024-04-19 13:11 ` Linus Walleij
2024-04-19 14:42 ` Aapo Vienamo
2024-04-21 18:33 ` Linus Walleij
2024-04-19 13:12 ` Andy Shevchenko
2024-04-19 13:32 ` Aapo Vienamo
2024-04-19 19:59 ` Elliott, Robert (Servers) [this message]
2024-04-19 22:02 ` Andy Shevchenko
2024-04-22 10:20 ` Bartosz Golaszewski
2024-04-22 20:59 ` Elliott, Robert (Servers)
2024-04-23 13:47 ` Ilpo Järvinen
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=MW5PR84MB1842F4C102CBFA73E861F420AB0D2@MW5PR84MB1842.NAMPRD84.PROD.OUTLOOK.COM \
--to=elliott@hpe.com \
--cc=aapo.vienamo@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=andy@kernel.org \
--cc=brgl@bgdev.pl \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.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®