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]
Message-ID: <54A91903.3020800@kernel.org>
Date:	Sun, 04 Jan 2015 10:42:11 +0000
From:	Jonathan Cameron <jic23@...nel.org>
To:	Hartmut Knaack <knaack.h@....de>,
	Daniel Baluta <daniel.baluta@...el.com>
CC:	lars@...afoo.de, pmeerw@...erw.net, linux-iio@...r.kernel.org,
	linux-kernel@...r.kernel.org, srinivas.pandruvada@...ux.intel.com
Subject: Re: [PATCH 02/10] iio: imu: kmx61: Don't ignore kmx61_set_power_state
 errors

On 01/01/15 13:45, Hartmut Knaack wrote:
> Daniel Baluta schrieb am 23.12.2014 um 14:22:
>> ..except while in an error handler, where there is nothing
>> to be done anyway.
>>
>> Signed-off-by: Daniel Baluta <daniel.baluta@...el.com>
> Reviewed-by: Hartmut Knaack <knaack.h@....de>
Applied
>> ---
>>  drivers/iio/imu/kmx61.c | 11 +++++++++--
>>  1 file changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/iio/imu/kmx61.c b/drivers/iio/imu/kmx61.c
>> index fe0cee7..e9cbd91 100644
>> --- a/drivers/iio/imu/kmx61.c
>> +++ b/drivers/iio/imu/kmx61.c
>> @@ -830,7 +830,12 @@ static int kmx61_read_raw(struct iio_dev *indio_dev,
>>  		}
>>  		mutex_lock(&data->lock);
>>  
>> -		kmx61_set_power_state(data, true, chan->address);
>> +		ret = kmx61_set_power_state(data, true, chan->address);
>> +		if (ret) {
>> +			mutex_unlock(&data->lock);
>> +			return ret;
>> +		}
>> +
>>  		ret = kmx61_read_measurement(data, base_reg, chan->scan_index);
>>  		if (ret < 0) {
>>  			kmx61_set_power_state(data, false, chan->address);
>> @@ -839,9 +844,11 @@ static int kmx61_read_raw(struct iio_dev *indio_dev,
>>  		}
>>  		*val = sign_extend32(ret >> chan->scan_type.shift,
>>  				     chan->scan_type.realbits - 1);
>> -		kmx61_set_power_state(data, false, chan->address);
>> +		ret = kmx61_set_power_state(data, false, chan->address);
>>  
>>  		mutex_unlock(&data->lock);
>> +		if (ret)
>> +			return ret;
>>  		return IIO_VAL_INT;
>>  	case IIO_CHAN_INFO_SCALE:
>>  		switch (chan->type) {
>>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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