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 <huangtao@rock-chips.com>
This commit is contained in:
Tao Huang 2018-02-07 18:42:49 +08:00
parent cdf1300d50
commit d97eb29a35

View File

@ -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);