diag: Release mutex in corner case

DIAG driver maintains a table for all registrations by remote
peripherals and user space applications. In certain cases, the
number of registrations can exceed table capacity. Thus, diag
re-allocates the table memory, to fit in all registrations.
This re-allocation stops at a threshold, even if requirement
is greater than threshold.

In such a corner case, if the requirement is greater than threshold,
then the mutex might remain locked after filling the table upto full
capacity. Adding unlocking condition to release mutex in such cases.

Change-Id: Iefd02795b531e17ff7cfe3be152e32b3e82c68fb
Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
diff --git a/drivers/char/diag/diagchar.h b/drivers/char/diag/diagchar.h
index 7d28604..371d319 100644
--- a/drivers/char/diag/diagchar.h
+++ b/drivers/char/diag/diagchar.h
@@ -52,8 +52,8 @@
 #define MAX_EQUIP_ID 12
 
 /* Maximum number of pkt reg supported at initialization*/
-extern unsigned int diag_max_registration;
-extern unsigned int diag_threshold_registration;
+extern unsigned int diag_max_reg;
+extern unsigned int diag_threshold_reg;
 
 #define APPEND_DEBUG(ch) \
 do {							\