From: munkyu.im Date: Thu, 5 Dec 2013 06:03:46 +0000 (+0900) Subject: nfc: arrange source codes X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~564^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F04%2F13404%2F1;p=sdk%2Femulator%2Fqemu.git nfc: arrange source codes Removed unused variables. Added checking data size. Change-Id: Ib3b818ce35733345ccdb281a5292a76a1dd160e6 Signed-off-by: munkyu.im --- diff --git a/tizen/src/hw/maru_virtio_nfc.c b/tizen/src/hw/maru_virtio_nfc.c index 3dc2120a6d..e4bf3f4c10 100644 --- a/tizen/src/hw/maru_virtio_nfc.c +++ b/tizen/src/hw/maru_virtio_nfc.c @@ -58,21 +58,11 @@ typedef struct MsgInfo static QTAILQ_HEAD(MsgInfoRecvHead , MsgInfo) nfc_recv_msg_queue = QTAILQ_HEAD_INITIALIZER(nfc_recv_msg_queue); - -static QTAILQ_HEAD(MsgInfoSendHead , MsgInfo) nfc_send_msg_queue = -QTAILQ_HEAD_INITIALIZER(nfc_send_msg_queue); - - -// - typedef struct NFCBuf { VirtQueueElement elem; QTAILQ_ENTRY(NFCBuf) next; } NFCBuf; -static QTAILQ_HEAD(NFCMsgHead , NFCBuf) nfc_in_queue = -QTAILQ_HEAD_INITIALIZER(nfc_in_queue); - static pthread_mutex_t recv_buf_mutex = PTHREAD_MUTEX_INITIALIZER; bool send_to_nfc(unsigned char id, unsigned char type, const char* data, const uint32_t len) @@ -87,6 +77,11 @@ bool send_to_nfc(unsigned char id, unsigned char type, const char* data, const u return false; } + if(len > MAX_BUF_SIZE) { + ERR("the length of data is longer than max buffer size"); + return false; + } + memset(&_msg->info, 0, sizeof(nfc_msg_info)); memcpy(_msg->info.buf, data, len);