aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/files/arch/mips
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2012-09-27 20:05:42 +0000
committerGabor Juhos <juhosg@openwrt.org>2012-09-27 20:05:42 +0000
commit170cd7a19a76556e3e07eec82b3848b552f007b8 (patch)
tree26f7470931fcb98de2cc0c8659abf0acfe51d32a /target/linux/ar71xx/files/arch/mips
parenta0df3fa315dd3480cbfd709ae690dd8b2b02be36 (diff)
downloadupstream-170cd7a19a76556e3e07eec82b3848b552f007b8.tar.gz
upstream-170cd7a19a76556e3e07eec82b3848b552f007b8.tar.bz2
upstream-170cd7a19a76556e3e07eec82b3848b552f007b8.zip
ar71xx: avoid possible NULL pointer dereference in ath79_init_{,local}_mac
SVN-Revision: 33575
Diffstat (limited to 'target/linux/ar71xx/files/arch/mips')
-rw-r--r--target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
index d2d0ee87f0..4487958bc7 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
@@ -992,7 +992,10 @@ void __init ath79_init_mac(unsigned char *dst, const unsigned char *src,
{
int t;
- if (!is_valid_ether_addr(src)) {
+ if (!dst)
+ return;
+
+ if (!src || !is_valid_ether_addr(src)) {
memset(dst, '\0', ETH_ALEN);
return;
}
@@ -1012,7 +1015,10 @@ void __init ath79_init_local_mac(unsigned char *dst, const unsigned char *src)
{
int i;
- if (!is_valid_ether_addr(src)) {
+ if (!dst)
+ return;
+
+ if (!src || !is_valid_ether_addr(src)) {
memset(dst, '\0', ETH_ALEN);
return;
}