mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <Mario.Limonciello@dell.com>
To: <crag0715@gmail.com>, <linux-usb@vger.kernel.org>,
	<netdev@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <hayeswang@realtek.com>,
	<Crag.Wang@dell.com>, <davem@davemloft.net>, <sjg@chromium.org>,
	<grundler@chromium.org>, <seanpaul@chromium.org>,
	<David.Chen7@Dell.com>, <kai.heng.feng@canonical.com>,
	<gustavo@embeddedor.com>,
	<charles.hyde@dell.corp-partner.google.com>,
	<bigeasy@linutronix.de>, <zhongjiang@huawei.com>
Subject: RE: [PATCH v2 1/1] r8152: sync sa_family with the media type of network device
Date: Mon, 22 Apr 2019 21:29:36 +0000	[thread overview]
Message-ID: <e6c274bbd120446fb58ceb6ba9528b4b@ausx13mpc124.AMER.DELL.COM> (raw)
In-Reply-To: <20190422050344.24513-1-crag0715@gmail.com>

> -----Original Message-----
> From: crag0715@gmail.com <crag0715@gmail.com>
> Sent: Monday, April 22, 2019 12:04 AM
> To: linux-usb@vger.kernel.org; netdev@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org; hayeswang@realtek.com; Limonciello, Mario;
> crag0715@gmail.com; Wang, Crag; David S. Miller; Simon Glass; Grant Grundler;
> Sean Paul; Chen7, David; Kai-Heng Feng; Gustavo A. R. Silva; Charles Hyde;
> Sebastian Andrzej Siewior; zhong jiang
> Subject: [PATCH v2 1/1] r8152: sync sa_family with the media type of network
> device
> 
> 
> [EXTERNAL EMAIL]
> 
> From: "Crag.Wang" <crag.wang@dell.com>
> 
> Without this patch the socket address family sporadically gets wrong
> value ends up the dev_set_mac_address() fails to set the desired MAC
> address.

Ah yes, this is because of an uninitialized struct sockaddr, so random garbage.
I didn't catch it during my testing, good catch.

> 
> Signed-off-by: Crag.Wang <crag.wang@dell.com>
> ---
>  drivers/net/usb/r8152.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
> index 4c63b40d5e00..41fb39ce69c9 100644
> --- a/drivers/net/usb/r8152.c
> +++ b/drivers/net/usb/r8152.c
> @@ -1225,6 +1225,8 @@ static int determine_ethernet_addr(struct r8152 *tp,
> struct sockaddr *sa)
>  	struct net_device *dev = tp->netdev;
>  	int ret;
> 
> +	sa->sa_family = dev->type;
> +
>  	if (tp->version == RTL_VER_01) {
>  		ret = pla_ocp_read(tp, PLA_IDR, 8, sa->sa_data);
>  	} else {
> --
> 2.20.1

Reviewed-By: Mario Limonciello <mario.limonciello@dell.com>

  parent reply	other threads:[~2019-04-23  2:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-22  5:03 crag0715
2019-04-22 20:39 ` Jakub Kicinski
2019-04-23  2:52   ` Crag Wang
2019-04-22 21:29 ` Mario.Limonciello [this message]
2019-04-23  5:15 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2019-04-22  2:23 crag0715
2019-04-22  2:44 ` David Miller
2019-04-22  3:17   ` Crag Wang
2019-04-22  4:48     ` David Miller

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=e6c274bbd120446fb58ceb6ba9528b4b@ausx13mpc124.AMER.DELL.COM \
    --to=mario.limonciello@dell.com \
    --cc=Crag.Wang@dell.com \
    --cc=David.Chen7@Dell.com \
    --cc=bigeasy@linutronix.de \
    --cc=charles.hyde@dell.corp-partner.google.com \
    --cc=crag0715@gmail.com \
    --cc=davem@davemloft.net \
    --cc=grundler@chromium.org \
    --cc=gustavo@embeddedor.com \
    --cc=hayeswang@realtek.com \
    --cc=kai.heng.feng@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=seanpaul@chromium.org \
    --cc=sjg@chromium.org \
    --cc=zhongjiang@huawei.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®