All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Cc: gregkh@linuxfoundation.org, neil@brown.name,
	driverdev-devel@linuxdriverproject.org
Subject: Re: [PATCH v2 08/11] staging: mt7621-gpio: avoid devm_kzalloc() hidden inside declarations
Date: Wed, 16 May 2018 11:04:52 +0300	[thread overview]
Message-ID: <20180516080452.hqmulvwr5cl3o6u3@mwanda> (raw)
In-Reply-To: <1526448604-3533-9-git-send-email-sergio.paracuellos@gmail.com>

On Wed, May 16, 2018 at 07:30:01AM +0200, Sergio Paracuellos wrote:
> diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c b/drivers/staging/mt7621-gpio/gpio-mt7621.c
> index c701259..2d16d62 100644
> --- a/drivers/staging/mt7621-gpio/gpio-mt7621.c
> +++ b/drivers/staging/mt7621-gpio/gpio-mt7621.c
> @@ -156,17 +156,18 @@ mediatek_gpio_bank_probe(struct platform_device *pdev, struct device_node *bank)
>  {
>  	struct mtk_data *gpio_data = dev_get_drvdata(&pdev->dev);
>  	const __be32 *id = of_get_property(bank, "reg", NULL);
> -	struct mtk_gc *rg = devm_kzalloc(&pdev->dev,
> -				sizeof(struct mtk_gc), GFP_KERNEL);
> +	struct mtk_gc *rg;
>  	int ret;
>  
> -	if (!rg || !id || be32_to_cpu(*id) > MTK_MAX_BANK)
> +	if (!id || be32_to_cpu(*id) > MTK_MAX_BANK)

You didn't introduce this, but it should be >= MTK_MAX_BANK.  (Off by
one).

regards,
dan carpenter

  reply	other threads:[~2018-05-16  8:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-16  5:29 [PATCH v2 00/11] staging: mt7621-gpio: use mediatek as binding instead of custom mtk Sergio Paracuellos
2018-05-16  5:29 ` [PATCH v2 01/11] staging: mt7621-gpio: dt-bindings: add documentation for mt7621-gpio Sergio Paracuellos
2018-05-16  5:29 ` [PATCH v2 02/11] staging: mt7621-gpio: update TODO file Sergio Paracuellos
2018-05-16  5:29 ` [PATCH v2 03/11] staging: mt7621-dts: update gpios related entries to use 'mediatek' Sergio Paracuellos
2018-05-16  5:29 ` [PATCH v2 04/11] staging: mt7621-gpio: replace 'mtk' to use correct one 'mediatek' Sergio Paracuellos
2018-05-16  5:29 ` [PATCH v2 05/11] staging: mt7621-gpio: avoid use of globals and use platform_data instead Sergio Paracuellos
2018-05-16  5:29 ` [PATCH v2 06/11] staging: mt7621-dts: add interrupt device tree nodes for the gpio controller Sergio Paracuellos
2018-05-16  5:30 ` [PATCH v2 07/11] staging: mt7621-gpio: dt-bindings: add interrupt nodes to bindings doc Sergio Paracuellos
2018-05-16  5:30 ` [PATCH v2 08/11] staging: mt7621-gpio: avoid devm_kzalloc() hidden inside declarations Sergio Paracuellos
2018-05-16  8:04   ` Dan Carpenter [this message]
2018-05-16  8:56     ` Sergio Paracuellos
2018-05-16  9:40       ` Dan Carpenter
2018-05-17  4:39         ` Sergio Paracuellos
2018-05-16  5:30 ` [PATCH v2 09/11] staging: mt7621-gpio: use ternary operator in return in mediatek_gpio_get_direction Sergio Paracuellos
2018-05-16  5:30 ` [PATCH v2 10/11] staging: mt7621-gpio: use MTK_BANK_WIDTH instead of magic number Sergio Paracuellos
2018-05-16  5:30 ` [PATCH v2 11/11] staging: mt7621-gpio: update TODO list Sergio Paracuellos

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=20180516080452.hqmulvwr5cl3o6u3@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=neil@brown.name \
    --cc=sergio.paracuellos@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 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.