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] [day] [month] [year] [list]
Message-ID: <alpine.LSU.2.20.1703061416160.31814@cbobk.fhfr.pm>
Date:   Mon, 6 Mar 2017 14:17:38 +0100 (CET)
From:   Jiri Kosina <jikos@...nel.org>
To:     Christophe JAILLET <christophe.jaillet@...adoo.fr>
cc:     benjamin.tissoires@...hat.com, briannorris@...omium.org,
        dianders@...omium.org, linux-input@...r.kernel.org,
        linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] HID: i2c-hid: Fix error handling

On Sun, 19 Feb 2017, Christophe JAILLET wrote:

> According to error handling in this function, it is likely that some
> resources should be freed before returning.
> Replace 'return ret', with 'goto err'.
> 
> While at it, remove some spaces at the beginning of the lines to be more
> consistent.
> 
> 
> Fixes: ead0687fe304a ("HID: i2c-hid: support regulator power on/off")
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
>  drivers/hid/i2c-hid/i2c-hid.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
> index d5288f3fb5ee..1a57ac2d8524 100644
> --- a/drivers/hid/i2c-hid/i2c-hid.c
> +++ b/drivers/hid/i2c-hid/i2c-hid.c
> @@ -1058,13 +1058,13 @@ static int i2c_hid_probe(struct i2c_client *client,
>  	}
>  
>  	ihid->pdata.supply = devm_regulator_get(&client->dev, "vdd");
> - 	if (IS_ERR(ihid->pdata.supply)) {
> - 		ret = PTR_ERR(ihid->pdata.supply);
> - 		if (ret != -EPROBE_DEFER)
> - 			dev_err(&client->dev, "Failed to get regulator: %d\n",
> - 				ret);
> - 		return ret;
> - 	}
> +	if (IS_ERR(ihid->pdata.supply)) {
> +		ret = PTR_ERR(ihid->pdata.supply);
> +		if (ret != -EPROBE_DEFER)
> +			dev_err(&client->dev, "Failed to get regulator: %d\n",
> +				ret);
> +		goto err;
> +	}

I don't see any spaces at the beginning of lines in the version that's in 
my tree ... o_O?

Therefore I've converted this patch into simple 'return ret -> goto err' 
transformation and applied on top for-4.12/i2c-hid.

Thanks,

-- 
Jiri Kosina
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ