linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Rix <trix@redhat.com>
To: Pan Bian <bianpan2016@163.com>, Mark Brown <broonie@kernel.org>,
	Xu Yilun <yilun.xu@intel.com>,
	Matthew Gerlach <matthew.gerlach@linux.intel.com>,
	Wu Hao <hao.wu@intel.com>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] spi: altera: Fix memory leak on error path
Date: Wed, 20 Jan 2021 07:03:42 -0800	[thread overview]
Message-ID: <29bc2be2-911e-e892-4d1c-cc5c8ce10571@redhat.com> (raw)
In-Reply-To: <20210120082635.49304-1-bianpan2016@163.com>


On 1/20/21 12:26 AM, Pan Bian wrote:
> Release master that have been previously allocated if the number of
> chipselect is invalid.
>
> Fixes: 8e04187c1bc7 ("spi: altera: add SPI core parameters support via platform data.")
> Signed-off-by: Pan Bian <bianpan2016@163.com>
> ---
>  drivers/spi/spi-altera.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/spi/spi-altera.c b/drivers/spi/spi-altera.c
> index cbc4c28c1541..62ea0c9e321b 100644
> --- a/drivers/spi/spi-altera.c
> +++ b/drivers/spi/spi-altera.c
> @@ -254,7 +254,8 @@ static int altera_spi_probe(struct platform_device *pdev)
>  			dev_err(&pdev->dev,
>  				"Invalid number of chipselect: %hu\n",
>  				pdata->num_chipselect);
> -			return -EINVAL;
> +			err = -EINVAL;
> +			goto exit;
>  		}
>  
>  		master->num_chipselect = pdata->num_chipselect;
Reviewed-by: Tom Rix <trix@redhat.com>


  parent reply	other threads:[~2021-01-20 15:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-20  8:26 [PATCH] spi: altera: Fix memory leak on error path Pan Bian
2021-01-20  8:35 ` Xu Yilun
2021-01-20 15:03 ` Tom Rix [this message]
2021-01-21  0:08 ` Mark Brown
2021-01-21 18:07 ` matthew.gerlach

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=29bc2be2-911e-e892-4d1c-cc5c8ce10571@redhat.com \
    --to=trix@redhat.com \
    --cc=bianpan2016@163.com \
    --cc=broonie@kernel.org \
    --cc=hao.wu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=matthew.gerlach@linux.intel.com \
    --cc=yilun.xu@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;
as well as URLs for NNTP newsgroup(s).