summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2008-08-28 19:13:51 +0200
committerJohn W. Linville <linville@tuxdriver.com>2008-09-05 16:15:24 -0400
commitfa9abe050d0a018b888fce61a4353afab17b0860 (patch)
tree385c3d6f3a2b6be59be9dfb533800bbec06d991e /drivers
parenta505f4ff49ff05ca9030069fab7de229dae7c819 (diff)
b43: Don't use memcpy for overlapping areas
It is valid to pass &gphy->rfatt and &gphy->bbatt as rfatt and bbatt pointer arguments to the function. So we have to use memmove for the possibly overlapping memory areas. Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/b43/phy_g.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/wireless/b43/phy_g.c b/drivers/net/wireless/b43/phy_g.c
index fce84896d34..063db5c00ce 100644
--- a/drivers/net/wireless/b43/phy_g.c
+++ b/drivers/net/wireless/b43/phy_g.c
@@ -232,11 +232,12 @@ void b43_set_txpower_g(struct b43_wldev *dev,
if (unlikely(tx_bias == 0xFF))
tx_bias = 0;
- /* Save the values for later */
+ /* Save the values for later. Use memmove, because it's valid
+ * to pass &gphy->rfatt as rfatt pointer argument. Same for bbatt. */
gphy->tx_control = tx_control;
- memcpy(&gphy->rfatt, rfatt, sizeof(*rfatt));
+ memmove(&gphy->rfatt, rfatt, sizeof(*rfatt));
gphy->rfatt.with_padmix = !!(tx_control & B43_TXCTL_TXMIX);
- memcpy(&gphy->bbatt, bbatt, sizeof(*bbatt));
+ memmove(&gphy->bbatt, bbatt, sizeof(*bbatt));
if (b43_debug(dev, B43_DBG_XMITPOWER)) {
b43dbg(dev->wl, "Tuning TX-power to bbatt(%u), "