kernel - fix MP lock mismatch in sys_lwp_rtprio()
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 16 Jan 2010 20:42:04 +0000 (12:42 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 16 Jan 2010 20:42:04 +0000 (12:42 -0800)
* sys_lwp_rtprio() was returning in certain cases without releasing
  the MP lock.

Reported-by: Sascha Wildner <swildner@crater.dragonflybsd.org>
sys/kern/kern_resource.c

index 77debe7..1c923b0 100644 (file)
@@ -373,10 +373,12 @@ sys_lwp_rtprio(struct lwp_rtprio_args *uap)
                case RTP_PRIO_REALTIME:
                case RTP_PRIO_NORMAL:
                case RTP_PRIO_IDLE:
-                       if (rtp.prio > RTP_PRIO_MAX)
-                               return EINVAL;
-                       lp->lwp_rtprio = rtp;
-                       error = 0;
+                       if (rtp.prio > RTP_PRIO_MAX) {
+                               error = EINVAL;
+                       } else {
+                               lp->lwp_rtprio = rtp;
+                               error = 0;
+                       }
                        break;
                default:
                        error = EINVAL;