diff options
author | Vitaliy Makkoveev <mvs@cvs.openbsd.org> | 2024-11-18 08:42:54 +0000 |
---|---|---|
committer | Vitaliy Makkoveev <mvs@cvs.openbsd.org> | 2024-11-18 08:42:54 +0000 |
commit | 1e37ee8eb1ed0f446c83058a058c109b08be4797 (patch) | |
tree | 2fcba2aa8dd1f926cf227feec7402c3914875b35 /sys/arch/sh | |
parent | 85f9fc6ccbc56c4224aba5691ddf913cffa886a7 (diff) |
Cast atomic_load_int(9) to signed int when loading `securelevel'.
The return value of atomic_load_int(9) is unsigned so needs a cast,
otherwise securelevel=-1 gets misrepresented.
From Paul Fertser.
Diffstat (limited to 'sys/arch/sh')
-rw-r--r-- | sys/arch/sh/sh/mem.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/sh/sh/mem.c b/sys/arch/sh/sh/mem.c index 88c15695034..f28c13cfc26 100644 --- a/sys/arch/sh/sh/mem.c +++ b/sys/arch/sh/sh/mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mem.c,v 1.13 2024/10/28 10:18:03 mvs Exp $ */ +/* $OpenBSD: mem.c,v 1.14 2024/11/18 08:42:53 mvs Exp $ */ /* $NetBSD: mem.c,v 1.21 2006/07/23 22:06:07 ad Exp $ */ /* @@ -108,7 +108,7 @@ mmopen(dev_t dev, int flag, int mode, struct proc *p) switch (minor(dev)) { case 0: case 1: - if (atomic_load_int(&securelevel) <= 0 || + if ((int)atomic_load_int(&securelevel) <= 0 || atomic_load_int(&allowkmem)) break; return (EPERM); |