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:	Fri, 2 Mar 2012 14:59:34 +0000
From:	Arnd Bergmann <arnd@...db.de>
To:	Ashish Jangam <ashish.jangam@...tcummins.com>
Cc:	Mark Brown <broonie@...nsource.wolfsonmicro.com>,
	linux-kernel@...r.kernel.org, Dajun <dajun.chen@...semi.com>,
	sameo@...ux.intel.com
Subject: Re: [PATCH 01/03] MFD: add ADC support to DA9052/53 MFD  core v2

On Friday 02 March 2012, Ashish Jangam wrote:
> +
> +       mutex_lock(&da9052->auxadc_lock);
> +
> +       /* Channel gets activated on enabling the Conversion bit */
> +       mux_sel = chan_mux[channel] | DA9052_ADC_MAN_MAN_CONV;
> +
> +       ret = da9052_reg_write(da9052, DA9052_ADC_MAN_REG, mux_sel);
> +       if (ret < 0)
> +               goto err;
> +
> +       /* Wait for an interrupt */
> +       wait_for_completion_timeout(&da9052->done, msecs_to_jiffies(500));

Shouldn't this check the return value of wait_for_completion_timeout
and return an error if it timed out?

If you don't expect a timeout to ever happen, it's probably better to
use wait_for_completion instead of wait_for_completion_timeout, but
if it can time out, you should handle it.

	Arnd
--
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