From: "Rafał Miłecki" <zajec5@gmail.com>
To: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>
Cc: "Rafał Miłecki" <zajec5@gmail.com>
Subject: [PATCH] bgmac: validate MAC addr
Date: Wed, 6 Feb 2013 10:37:32 +0100 [thread overview]
Message-ID: <1360143452-29183-1-git-send-email-zajec5@gmail.com> (raw)
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
drivers/net/ethernet/broadcom/bgmac.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index af149a3..9f95089 100644
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -1290,6 +1290,11 @@ static int bgmac_probe(struct bcma_device *core)
return -ENOTSUPP;
}
+ if (!is_valid_ether_addr(mac)) {
+ dev_err(&core->dev, "Invalid MAC addr: %pM\n", mac);
+ return -EADDRNOTAVAIL;
+ }
+
/* Allocation and references */
net_dev = alloc_etherdev(sizeof(*bgmac));
if (!net_dev)
--
1.7.10.4
next reply other threads:[~2013-02-06 9:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-06 9:37 Rafał Miłecki [this message]
2013-02-06 17:11 ` [PATCH] bgmac: validate MAC addr Florian Fainelli
2013-02-07 10:14 ` [PATCH V2] " Rafał Miłecki
2013-02-07 10:19 ` Florian Fainelli
2013-02-07 10:27 ` [PATCH V3] bgmac: validate (and random if needed) " Rafał Miłecki
2013-02-08 22:42 ` 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=1360143452-29183-1-git-send-email-zajec5@gmail.com \
--to=zajec5@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).