mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: linux-kernel@vger.kernel.org
Cc: Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Quentin Schulz <quentin.schulz@bootlin.com>
Subject: Re: [PATCH net-next v2 1/2] net: phy: mscc: fix signedness bug in vsc85xx_downshift_get
Date: Tue, 16 Oct 2018 10:51:35 +0200	[thread overview]
Message-ID: <380aac12-05b4-3f77-f583-fb72ec98a8ab@embeddedor.com> (raw)
In-Reply-To: <ed7a48646940771a09ede1202ed19f13773c7723.1539159556.git.gustavo@embeddedor.com>

Hi,

On 10/10/18 10:30 AM, Gustavo A. R. Silva wrote:
> Currently, the error handling for the call to function
> phy_read_paged() doesn't work because *reg_val* is of
> type u16 (16 bits, unsigned), which makes it impossible
> for it to hold a value less than 0.
> 
> Fix this by changing the type of variable *reg_val* to int.
> 
> Addresses-Coverity-ID: 1473970 ("Unsigned compared against 0")
> Fixes: 6a0bfbbe20b0 ("net: phy: mscc: migrate to phy_select/restore_page functions")
> Reviewed-by: Quentin Schulz <quentin.schulz@bootlin.com>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
> Changes in v2:
>  - Add Quentin's Reviewed-by to the commit log.
> 
>  drivers/net/phy/mscc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/phy/mscc.c b/drivers/net/phy/mscc.c
> index bffe077..bff56c3 100644
> --- a/drivers/net/phy/mscc.c
> +++ b/drivers/net/phy/mscc.c
> @@ -522,7 +522,7 @@ static int vsc85xx_mdix_set(struct phy_device *phydev, u8 mdix)
>  
>  static int vsc85xx_downshift_get(struct phy_device *phydev, u8 *count)
>  {
> -	u16 reg_val;
> +	int reg_val;
>  
>  	reg_val = phy_read_paged(phydev, MSCC_PHY_PAGE_EXTENDED,
>  				 MSCC_PHY_ACTIPHY_CNTL);
> 

Friendly ping. Dave, can you take this?

Thanks!
--
Gustavo

  reply	other threads:[~2018-10-16  9:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-10  8:29 [PATCH net-next v2 0/2] fix signedness bug and memory leak in mscc driver Gustavo A. R. Silva
2018-10-10  8:30 ` [PATCH net-next v2 1/2] net: phy: mscc: fix signedness bug in vsc85xx_downshift_get Gustavo A. R. Silva
2018-10-16  8:51   ` Gustavo A. R. Silva [this message]
2018-10-10  8:31 ` [PATCH net-next v2 2/2] net: phy: mscc: fix memory leak in vsc8574_config_pre_init Gustavo A. R. Silva
2018-10-10  8:34   ` Quentin Schulz
2018-10-16  8:49     ` Gustavo A. R. Silva
2018-10-16 16:54       ` David Miller
2018-10-16 17:03         ` Gustavo A. R. Silva

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=380aac12-05b4-3f77-f583-fb72ec98a8ab@embeddedor.com \
    --to=gustavo@embeddedor.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quentin.schulz@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®