src/hw/maru_touchscreen.c: fix wrong buffer size to memset
authorIgor Mitsyanko <i.mitsyanko@samsung.com>
Wed, 1 Aug 2012 08:56:56 +0000 (12:56 +0400)
committerEvgeny Voevodin <e.voevodin@samsung.com>
Tue, 18 Sep 2012 06:20:24 +0000 (10:20 +0400)
To clear buffer usb_touchscreen_handle_data() function called a memset function
with length longer then actual length of buffer, it resulted in USB packet corruption.

Signed-off-by: Igor Mitsyanko <i.mitsyanko@samsung.com>
tizen/src/hw/maru_usb_touchscreen.c

index a2c55ea..2d3593f 100644 (file)
@@ -186,7 +186,7 @@ static int usb_touchscreen_handle_data(USBDevice *dev, USBPacket *p)
 
             pthread_mutex_unlock(&event_mutex);
 
-            memset(buf, 0, sizeof(buf) * (p->iov.size - 1));
+            memset(buf, 0, sizeof(buf));
             ret = usb_touchscreen_poll(s, buf, p->iov.size); //write event to packet
             usb_packet_copy(p, buf, ret);
             break;