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>
Mon, 20 Aug 2012 12:50:13 +0000 (16:50 +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_touchscreen.c

index 151a9244848a611e43ceb7664d1dbdaeb71128d6..0e9a2e2a4b2e000e4a31dd95749647b0634c35ff 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;