linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Vladimirs Ambrosovs <rodriguez.twister@gmail.com>,
	sudipm.mukherjee@gmail.com, daniel.baluta@intel.com,
	dan.carpenter@oracle.com, gregkh@linuxfoundation.org
Cc: cristina.opriceana@gmail.com,
	driverdev-devel@linuxdriverproject.org,
	linux-iio@vger.kernel.org
Subject: Re: [PATCH v3 1/3] staging: iio_simple_dummy: fix init function
Date: Mon, 01 Jun 2015 11:21:21 +0100	[thread overview]
Message-ID: <556C3221.5090001@kernel.org> (raw)
In-Reply-To: <1432974017-24547-2-git-send-email-rodriguez.twister@gmail.com>

On 30/05/15 09:20, Vladimirs Ambrosovs wrote:
> This patch fixes the init function for the iio_simple_dummy driver.
> The main issues were absence of kfree for the allocated array, and no
> devices being removed in case the probe function fails, running in a loop.
> 
> Signed-off-by: Vladimirs Ambrosovs <rodriguez.twister@gmail.com>
Thanks,

Applied to the togreg branch of iio.git which will get pushed
out as testing for the autobuilders to play with it once
I'm home from the fools errand I am currently on in a clean room
with no internet...

Jonathan
> ---
>  drivers/staging/iio/iio_simple_dummy.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/iio/iio_simple_dummy.c b/drivers/staging/iio/iio_simple_dummy.c
> index b47bf9f..d0a9963 100644
> --- a/drivers/staging/iio/iio_simple_dummy.c
> +++ b/drivers/staging/iio/iio_simple_dummy.c
> @@ -722,9 +722,16 @@ static __init int iio_dummy_init(void)
>  	for (i = 0; i < instances; i++) {
>  		ret = iio_dummy_probe(i);
>  		if (ret < 0)
> -			return ret;
> +			goto error_remove_devs;
>  	}
>  	return 0;
> +
> +error_remove_devs:
> +	while (i--)
> +		iio_dummy_remove(i);
> +
> +	kfree(iio_dummy_devs);
> +	return ret;
>  }
>  module_init(iio_dummy_init);
>  
> 


  reply	other threads:[~2015-06-01 21:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-30  8:20 [PATCH v3 0/3] staging: iio_simple_dummy: minor driver fixes Vladimirs Ambrosovs
2015-05-30  8:20 ` [PATCH v3 1/3] staging: iio_simple_dummy: fix init function Vladimirs Ambrosovs
2015-06-01 10:21   ` Jonathan Cameron [this message]
2015-05-30  8:20 ` [PATCH v3 2/3] staging: iio_simple_dummy: fix return types Vladimirs Ambrosovs
2015-06-01 10:21   ` Jonathan Cameron
2015-05-30  8:20 ` [PATCH v3 3/3] staging: iio_simple_dummy: fix module_param type Vladimirs Ambrosovs
2015-06-01 10:23   ` Jonathan Cameron

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=556C3221.5090001@kernel.org \
    --to=jic23@kernel.org \
    --cc=cristina.opriceana@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=daniel.baluta@intel.com \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=rodriguez.twister@gmail.com \
    --cc=sudipm.mukherjee@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 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).