mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-29 18:19:02 +00:00
ar71xx: avoid possible NULL pointer dereference in ath79_init_{,local}_mac
SVN-Revision: 33575
This commit is contained in:
parent
a0df3fa315
commit
170cd7a19a
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user