diag: Fix race condition in diag mempool

Diag driver manages memory using memory pools. Allocation and
de-allocation of memory depends on global count variables. This
patch adds lock in allocation/free functions to protect those
global variables.

Change-Id: I908687c0ccb51c7901dfb3559262046abd2e8e27
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
diff --git a/drivers/char/diag/diagchar.h b/drivers/char/diag/diagchar.h
index 7154942..576e5e4 100644
--- a/drivers/char/diag/diagchar.h
+++ b/drivers/char/diag/diagchar.h
@@ -301,7 +301,7 @@
 	mempool_t *diag_hdlc_pool;
 	mempool_t *diag_user_pool;
 	mempool_t *diag_write_struct_pool;
-	struct mutex diagmem_mutex;
+	spinlock_t diag_mem_lock;
 	int count;
 	int count_hdlc_pool;
 	int count_user_pool;