diff options
author | Julien Grall <julien.grall@citrix.com> | 2015-09-03 22:59:50 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-09-08 20:40:23 (GMT) |
commit | 5b902d6f97f573fde911338e5d943e6b07fac7f9 (patch) | |
tree | 0558c3d3deace7e53bc3efbab3f17f27f73b22f0 /drivers/net/dsa/bcm_sf2.c | |
parent | fcb0bb6aab256288a4e0a8650d26e4096ec30319 (diff) | |
download | linux-5b902d6f97f573fde911338e5d943e6b07fac7f9.tar.xz |
device property: Don't overwrite addr when failing in device_get_mac_address
The function device_get_mac_address is trying different property names
in order to get the mac address. To check the return value, the variable
addr (which contain the buffer pass by the caller) will be re-used. This
means that if the previous property is not found, the next property will
be read using a NULL buffer.
Therefore it's only possible to retrieve the mac if node contains a
property "mac-address". Fix it by using a temporary buffer for the
return value.
This has been introduced by commit 4c96b7dc0d393f12c17e0d81db15aa4a820a6ab3
"Add a matching set of device_ functions for determining mac/phy"
Signed-off-by: Julien Grall <julien.grall@citrix.com>
Cc: Jeremy Linton <jeremy.linton@arm.com>
Cc: David S. Miller <davem@davemloft.net>
Reviewed-by: Jeremy Linton <jeremy.linton@arm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/bcm_sf2.c')
0 files changed, 0 insertions, 0 deletions