Skip to contentSkip to conversation

linux-user: do_shmdt(): Fix page_set_flags's 2nd arg.

PATCH Applied [email protected] 3 participants 3 messages Apr 10, 2010 – Apr 13, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-user: do_shmdt(): Fix page_set_flags's 2nd arg.

2nd arg of page_set_flags() should be start+size, but size.

---
 linux-user/syscall.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
linux-user/syscall.c +1 -1
index a03e432..26c0fb4 100644
@@ -2752,7 +2752,7 @@ static inline abi_long do_shmdt(abi_ulong shmaddr)
     for (i = 0; i < N_SHM_REGIONS; ++i) {
         if (shm_regions[i].start == shmaddr) {
             shm_regions[i].start = 0;
-            page_set_flags(shmaddr, shm_regions[i].size, 0);
+            page_set_flags(shmaddr, shmaddr + shm_regions[i].size, 0);
             break;
         }
     }
Signature · 1 line
1.6.5
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · On 04/10/2010 10:09 AM, [email protected] wrote:

2nd arg of page_set_flags() should be start+size, but size.

Quoted 17 lines
---
  linux-user/syscall.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
linux-user/syscall.c +1 -1
index a03e432..26c0fb4 100644
@@ -2752,7 +2752,7 @@ static inline abi_long do_shmdt(abi_ulong shmaddr)
      for (i = 0; i<  N_SHM_REGIONS; ++i) {
          if (shm_regions[i].start == shmaddr) {
              shm_regions[i].start = 0;
-            page_set_flags(shmaddr, shm_regions[i].size, 0);
+            page_set_flags(shmaddr, shmaddr + shm_regions[i].size, 0);
              break;
          }
      }
#2 lore raw
In reply to [email protected]
Quoted 3 lines · On Sun, Apr 11, 2010 at 02:09:57AM +0900, [email protected] wrote:

2nd arg of page_set_flags() should be start+size, but size.

Thanks, applied.

Quoted 23 lines
---
 linux-user/syscall.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
linux-user/syscall.c +1 -1
index a03e432..26c0fb4 100644
@@ -2752,7 +2752,7 @@ static inline abi_long do_shmdt(abi_ulong shmaddr)
     for (i = 0; i < N_SHM_REGIONS; ++i) {
         if (shm_regions[i].start == shmaddr) {
             shm_regions[i].start = 0;
-            page_set_flags(shmaddr, shm_regions[i].size, 0);
+            page_set_flags(shmaddr, shmaddr + shm_regions[i].size, 0);
             break;
         }
     }
Signature · 1 line
1.6.5
Signature · 2 lines
Aurelien Jarno                          GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net