User: | Jiri Slaby |
Error type: | Resource Leak |
Error type description: | The code omits to put the resource to the system for reuse |
File location: | arch/x86/xen/irq.c |
Line in file: | 85 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Stanse
(1.2)
|
Entered: | 2011-11-07 22:40:13 UTC |
55{ 56 struct vcpu_info *vcpu; 57 58 /* convert from IF type flag */ 59 flags = !(flags & X86_EFLAGS_IF); 60 61 /* There's a one instruction preempt window here. We need to 62 make sure we're don't switch CPUs between getting the vcpu 63 pointer and updating the mask. */ 64 preempt_disable(); 65 vcpu = x86_read_percpu(xen_vcpu); 66 vcpu->evtchn_upcall_mask = flags; 67 preempt_enable_no_resched(); 68 69 /* Doesn't matter if we get preempted here, because any 70 pending event will get dealt with anyway. */ 71 72 if (flags == 0) { 73 preempt_check_resched(); 74 barrier(); /* unmask then check (avoid races) */ 75 if (unlikely(vcpu->evtchn_upcall_pending)) 76 xen_force_evtchn_callback(); 77 } 78} 79 80static void xen_irq_disable(void) 81{ 82 /* There's a one instruction preempt window here. We need to 83 make sure we're don't switch CPUs between getting the vcpu 84 pointer and updating the mask. */ 85 preempt_disable(); 86 x86_read_percpu(xen_vcpu)->evtchn_upcall_mask = 1; 87 preempt_enable_no_resched(); 88} 89 90static void xen_irq_enable(void) 91{ 92 struct vcpu_info *vcpu; 93 94 /* We don't need to worry about being preempted here, since 95 either a) interrupts are disabled, so no preemption, or b)