From d97eb29a355d98743b5a57d6d0e421959c19e62e Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Wed, 7 Feb 2018 18:42:49 +0800 Subject: [PATCH] hid/hid-rkvr: fix compile warning drivers/hid/hid-rkvr.c:780:3: warning: memcpy writing 9 bytes into a region of size 1 overflows the destination [-Wstringop-overflow=] Change-Id: If4859756f19cb692bcc3584ff707c135749e73e4 Signed-off-by: Tao Huang --- drivers/hid/hid-rkvr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hid/hid-rkvr.c b/drivers/hid/hid-rkvr.c index f37c03c6485c..e38d38620f10 100644 --- a/drivers/hid/hid-rkvr.c +++ b/drivers/hid/hid-rkvr.c @@ -769,8 +769,8 @@ static int hid_report_readreg(struct device *dev, u8 reg, u8 *data, int len) struct hid_device *hid = container_of(dev, struct hid_device, dev); unsigned char report_number = reg; unsigned char report_type = HID_REGR_REPORT; - char buf[1 + sizeof(data) * len]; - int readlen = 1 + sizeof(data) * len; + char buf[1 + sizeof(*data) * len]; + int readlen = 1 + sizeof(*data) * len; int ret; ret = hid_hw_raw_request(hid, report_number, (unsigned char *)buf, readlen, report_type, HID_REQ_GET_REPORT);