Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
[platform/adaptation/renesas_rcar/renesas_kernel.git] / net / irda / irqueue.c
index 9266233..40c28ef 100644 (file)
@@ -28,7 +28,7 @@
  *     published by the Free Software Foundation; either version 2 of
  *     the License, or (at your option) any later version.
  *
- *     Neither Dag Brattli nor University of Tromsø admit liability nor
+ *     Neither Dag Brattli nor University of Tromsø admit liability nor
  *     provide warranty for any of this software. This material is
  *     provided "AS-IS" and at no charge.
  *
@@ -384,6 +384,9 @@ EXPORT_SYMBOL(hashbin_new);
  *    for deallocating this structure if it's complex. If not the user can
  *    just supply kfree, which should take care of the job.
  */
+#ifdef CONFIG_LOCKDEP
+static int hashbin_lock_depth = 0;
+#endif
 int hashbin_delete( hashbin_t* hashbin, FREE_FUNC free_func)
 {
        irda_queue_t* queue;
@@ -395,7 +398,8 @@ int hashbin_delete( hashbin_t* hashbin, FREE_FUNC free_func)
 
        /* Synchronize */
        if ( hashbin->hb_type & HB_LOCK ) {
-               spin_lock_irqsave(&hashbin->hb_spinlock, flags);
+               spin_lock_irqsave_nested(&hashbin->hb_spinlock, flags,
+                                        hashbin_lock_depth++);
        }
 
        /*
@@ -419,6 +423,9 @@ int hashbin_delete( hashbin_t* hashbin, FREE_FUNC free_func)
        /* Release lock */
        if ( hashbin->hb_type & HB_LOCK) {
                spin_unlock_irqrestore(&hashbin->hb_spinlock, flags);
+#ifdef CONFIG_LOCKDEP
+               hashbin_lock_depth--;
+#endif
        }
 
        /*