Skip to contentSkip to conversation

az6007: fix incorrect memcpy

PATCH RESEND New Alan Cox 1 participant 1 message Jul 24, 2012 Media (V4L/DVB)

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH RESEND 1/1 az6007: fix incorrect memcpy

From: Alan Cox <[email protected]>

Some parts of the C language are subtle and evil. This is one example.

Reported-by [email protected]

Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=44041

---

 drivers/media/dvb/dvb-usb/az6007.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/dvb/dvb-usb/az6007.c +1 -1
index 8ffcad0..86861e6 100644
@@ -590,7 +590,7 @@ static int az6007_read_mac_addr(struct dvb_usb_device *d, u8 mac[6])
 	int ret;
 
 	ret = az6007_read(d, AZ6007_READ_DATA, 6, 0, st->data, 6);
-	memcpy(mac, st->data, sizeof(mac));
+	memcpy(mac, st->data, 6);
 
 	if (ret > 0)
 		deb_info("%s: mac is %pM\n", __func__, mac);