1
Index: linux-2.6-apparmor/security/apparmor/inline.h
2
===================================================================
3
--- linux-2.6-apparmor.orig/security/apparmor/inline.h
4
+++ linux-2.6-apparmor/security/apparmor/inline.h
5
@@ -143,6 +143,8 @@ static inline void unlock_profile(struct
8
* lock_both_profiles - lock two profiles in a deadlock-free way
9
+ * @profile1: profile to lock (may be NULL)
10
+ * @profile2: profile to lock (may be NULL)
12
* The order in which profiles are passed into lock_both_profiles() /
13
* unlock_both_profiles() does not matter.
14
@@ -172,11 +174,13 @@ static inline void lock_both_profiles(st
16
spin_lock_irqsave(&profile2->lock, profile2->int_flags);
17
} else if (profile1 > profile2) {
18
+ /* profile1 cannot be NULL here. */
19
spin_lock_irqsave(&profile1->lock, profile1->int_flags);
21
spin_lock(&profile2->lock);
24
+ /* profile2 cannot be NULL here. */
25
spin_lock_irqsave(&profile2->lock, profile2->int_flags);
26
spin_lock(&profile1->lock);
28
@@ -184,6 +188,8 @@ static inline void lock_both_profiles(st
31
* unlock_both_profiles - unlock two profiles in a deadlock-free way
32
+ * @profile1: profile to unlock (may be NULL)
33
+ * @profile2: profile to unlock (may be NULL)
35
* The order in which profiles are passed into lock_both_profiles() /
36
* unlock_both_profiles() does not matter.
37
@@ -205,10 +211,12 @@ static inline void unlock_both_profiles(
38
spin_unlock_irqrestore(&profile2->lock,
40
} else if (profile1 > profile2) {
41
+ /* profile1 cannot be NULL here. */
43
spin_unlock(&profile2->lock);
44
spin_unlock_irqrestore(&profile1->lock, profile1->int_flags);
46
+ /* profile2 cannot be NULL here. */
47
spin_unlock(&profile1->lock);
48
spin_unlock_irqrestore(&profile2->lock, profile2->int_flags);