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: <Y+Z2xs8gu8eV5rS1@matsya>
Date:   Fri, 10 Feb 2023 22:24:30 +0530
From:   Vinod Koul <vkoul@...nel.org>
To:     Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
Cc:     kishon@...nel.org, heiko@...ech.de, p.zabel@...gutronix.de,
        linux-phy@...ts.infradead.org,
        linux-arm-kernel@...ts.infradead.org,
        linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Abaci Robot <abaci@...ux.alibaba.com>
Subject: Re: [PATCH] phy: rockchip-typec: Fix unsigned comparison with less
 than zero

On 07-02-23, 13:26, Jiapeng Chong wrote:
> The dp is defined as bool type, the return value type of function
> extcon_get_state should be int, at the same time,if(dp>0) is used as the
> conditional statement, so the type of dp is modified to int.
> 
> ./drivers/phy/rockchip/phy-rockchip-typec.c:827:12-14: WARNING: Unsigned expression compared with zero: dp > 0.

You should see same error for ufp as well, that also stores return of
extcon_get_state()

> 
> Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3962
> Signed-off-by: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
> ---
>  drivers/phy/rockchip/phy-rockchip-typec.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/phy/rockchip/phy-rockchip-typec.c b/drivers/phy/rockchip/phy-rockchip-typec.c
> index 6aea512e5d4e..85ed7d510cbf 100644
> --- a/drivers/phy/rockchip/phy-rockchip-typec.c
> +++ b/drivers/phy/rockchip/phy-rockchip-typec.c
> @@ -808,9 +808,9 @@ static int tcphy_get_mode(struct rockchip_typec_phy *tcphy)
>  	struct extcon_dev *edev = tcphy->extcon;
>  	union extcon_property_value property;
>  	unsigned int id;
> -	bool ufp, dp;
> +	bool ufp;
>  	u8 mode;
> -	int ret;
> +	int ret, dp;
>  
>  	if (!edev)
>  		return MODE_DFP_USB;
> -- 
> 2.20.1.7.g153144c

-- 
~Vinod

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ