Netdev List
 help / color / mirror / Atom feed
From: Hariprasad Kelam <hkelam@marvell.com>
To: Shigeru Yoshida <syoshida@redhat.com>
Cc: <make24@iscas.ac.cn>, <davem@davemloft.net>,
	<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
	<liujunliang_ljl@163.com>, <andrew@lunn.ch>, <horms@kernel.org>,
	<linux-usb@vger.kernel.org>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <stable@vger.kernel.org>
Subject: Re: [PATCH net v4] net: usb: sr9700: fix uninitialized variable use in sr_mdio_read
Date: Thu, 25 Jul 2024 13:36:42 +0530	[thread overview]
Message-ID: <ZqIHkubX0KK8psPv@test-OptiPlex-Tower-Plus-7010> (raw)
In-Reply-To: <20240725.120100.2041590414991833213.syoshida@redhat.com>

On 2024-07-25 at 08:31:00, Shigeru Yoshida (syoshida@redhat.com) wrote:
> On Thu, 25 Jul 2024 10:29:42 +0800, Ma Ke wrote:
> > It could lead to error happen because the variable res is not updated if
> > the call to sr_share_read_word returns an error. In this particular case
> > error code was returned and res stayed uninitialized. Same issue also
> > applies to sr_read_reg.
> > 
> > This can be avoided by checking the return value of sr_share_read_word
> > and sr_read_reg, and propagating the error if the read operation failed.
> > 
> > Found by code review.
> > 
> > Cc: stable@vger.kernel.org
> > Fixes: c9b37458e956 ("USB2NET : SR9700 : One chip USB 1.1 USB2NET SR9700Device Driver Support")
> > Signed-off-by: Ma Ke <make24@iscas.ac.cn>
> 
> I did a quick check for sr9700.c and there seems to be other
> suspicious usage of sr_read_reg().  But, for sr_mdio_read(), I think
> the patch is sufficient.
> 
> Reviewed-by: Shigeru Yoshida <syoshida@redhat.com>
> 
>  Agree with Shigeru, may be you can submit another patch addressing
>  "suspicious usage of sr_read_reg" this patch looks good

Reviewed-by: Hariprasad Kelam <hkelam@marvell.com>

  reply	other threads:[~2024-07-25  8:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-25  2:29 [PATCH net v4] net: usb: sr9700: fix uninitialized variable use in sr_mdio_read Ma Ke
2024-07-25  3:01 ` Shigeru Yoshida
2024-07-25  8:06   ` Hariprasad Kelam [this message]
2024-07-26 10:20 ` patchwork-bot+netdevbpf

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=ZqIHkubX0KK8psPv@test-OptiPlex-Tower-Plus-7010 \
    --to=hkelam@marvell.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=liujunliang_ljl@163.com \
    --cc=make24@iscas.ac.cn \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=syoshida@redhat.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