lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 22 Mar 2010 12:27:05 +0000
From:	Jonathan Cameron <jic23@....ac.uk>
To:	sonic zhang <sonic.adi@...il.com>
CC:	Linux Kernel <linux-kernel@...r.kernel.org>,
	linux-iio <linux-iio@...r.kernel.org>, Greg KH <greg@...ah.com>
Subject: Re: [PATCH] iio: Function iio_get_new_idr_val() return negative value
 if fails.

On 03/22/10 10:23, sonic zhang wrote:
> 
> Function iio_get_new_idr_val() return negative value if fails.
> So, only error when ret < 0 in iio_device_register_eventset().
> 
> Signed-off-by: Sonic Zhang <sonic.adi@...il.com>
Youch.  I'm amazed that one hasn't caused more trouble!
Thanks Sonic.  I would normally say the comment is unnecessary 
but then the error suggests it is worth having it.
Actually, it would probably be better to put the docs
in the header rather than here.

Otherwise, (and given the nature of the fix I'm not
that bothered about the comment location).

Acked-by: Jonathan Cameron <jic23@....ac.uk>

cc'd Greg KH. (please do this with patches that are bug fixes
that don't need much discussion like this one) The drivers
are in his staging tree so that's the route for merging
this sort of fix. 

> ---
>  drivers/staging/iio/industrialio-core.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/staging/iio/industrialio-core.c b/drivers/staging/iio/industrialio-core.c
> index b456dfc..dd9267c 100644
> --- a/drivers/staging/iio/industrialio-core.c
> +++ b/drivers/staging/iio/industrialio-core.c
> @@ -536,6 +536,7 @@ static void iio_device_unregister_sysfs(struct iio_dev *dev_info)
>  	sysfs_remove_group(&dev_info->dev.kobj, dev_info->attrs);
>  }
>  
> +/* This function return negative value if fails. */
>  int iio_get_new_idr_val(struct idr *this_idr)
>  {
>  	int ret;
> @@ -659,7 +660,7 @@ static int iio_device_register_eventset(struct iio_dev *dev_info)
>  	for (i = 0; i < dev_info->num_interrupt_lines; i++) {
>  		dev_info->event_interfaces[i].owner = dev_info->driver_module;
>  		ret = iio_get_new_idr_val(&iio_event_idr);
> -		if (ret)
> +		if (ret < 0)
>  			goto error_free_setup_ev_ints;
>  		else
>  			dev_info->event_interfaces[i].id = ret;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ