diff mbox

ir-keytable: avoid double lock

Message ID 20100401155438.GE5265@bicker (mailing list archive)
State Superseded
Headers show

Commit Message

Dan Carpenter April 1, 2010, 3:54 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c
index 0a3b4ed..51cd0f3 100644
--- a/drivers/media/IR/ir-keytable.c
+++ b/drivers/media/IR/ir-keytable.c
@@ -216,7 +216,7 @@  static void ir_delete_key(struct ir_scancode_table *rc_tab, int elem)
 		memcpy(&newkeymap[elem], &oldkeymap[elem + 1],
 		       (newsize - elem) * sizeof(*newkeymap));
 
-	if (resize) {
+	if (resize && newkeymap != oldkeymap) {
 		/*
 		 * As the copy happened to a temporary table, only here
 		 * it needs to lock while replacing the table pointers