[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55C07A7F.9070309@ti.com>
Date: Tue, 4 Aug 2015 11:40:31 +0300
From: Roger Quadros <rogerq@...com>
To: Dan Carpenter <dan.carpenter@...cle.com>,
MyungJoo Ham <myungjoo.ham@...sung.com>
CC: Chanwoo Choi <cw00.choi@...sung.com>,
<linux-kernel@...r.kernel.org>, <kernel-janitors@...r.kernel.org>
Subject: Re: [patch] extcon: signedness bugs break error handling
On 04/08/15 10:47, Dan Carpenter wrote:
> Unsigned is never less than zero so this error handling won't work.
>
> Fixes: be052cc87745 ('extcon: Fix hang and extcon_get/set_cable_state().')
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
Thanks Dan.
Reviewed-by: Roger Quadros <rogerq@...com>
cheers,
-roger
>
> diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
> index 8301a72..da2fb6c 100644
> --- a/drivers/extcon/extcon.c
> +++ b/drivers/extcon/extcon.c
> @@ -143,7 +143,7 @@ static int find_cable_id_by_name(struct extcon_dev *edev, const char *name)
>
> static int find_cable_index_by_name(struct extcon_dev *edev, const char *name)
> {
> - unsigned int id;
> + int id;
>
> if (edev->max_supported == 0)
> return -EINVAL;
> @@ -379,7 +379,7 @@ EXPORT_SYMBOL_GPL(extcon_get_cable_state_);
> */
> int extcon_get_cable_state(struct extcon_dev *edev, const char *cable_name)
> {
> - unsigned int id;
> + int id;
>
> id = find_cable_id_by_name(edev, cable_name);
> if (id < 0)
> @@ -430,7 +430,7 @@ EXPORT_SYMBOL_GPL(extcon_set_cable_state_);
> int extcon_set_cable_state(struct extcon_dev *edev,
> const char *cable_name, bool cable_state)
> {
> - unsigned int id;
> + int id;
>
> id = find_cable_id_by_name(edev, cable_name);
> if (id < 0)
>
--
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