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

login
register
mail settings
Submitter takasi-y@ops.dti.ne.jp
Date April 10, 2010, 5:09 p.m.
Message ID <201004101709.o3AH9vx8029942@smtp12.dti.ne.jp>
Download mbox | patch
Permalink /patch/49906/
State New
Headers show

Comments

takasi-y@ops.dti.ne.jp - April 10, 2010, 5:09 p.m.
2nd arg of page_set_flags() should be start+size, but size.

Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp>
---
 linux-user/syscall.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Richard Henderson - April 11, 2010, 11:05 p.m.
On 04/10/2010 10:09 AM, takasi-y@ops.dti.ne.jp wrote:
> 2nd arg of page_set_flags() should be start+size, but size.
>
> Signed-off-by: Takashi YOSHII<takasi-y@ops.dti.ne.jp>

Acked-by: Richard Henderson <rth@twiddle.net>


> ---
>   linux-user/syscall.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index a03e432..26c0fb4 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -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;
>           }
>       }
Aurelien Jarno - April 13, 2010, 10:19 p.m.
On Sun, Apr 11, 2010 at 02:09:57AM +0900, takasi-y@ops.dti.ne.jp wrote:
> 2nd arg of page_set_flags() should be start+size, but size.
> 
> Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp>

Thanks, applied.

> ---
>  linux-user/syscall.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index a03e432..26c0fb4 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -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;
>          }
>      }
> -- 
> 1.6.5
> 
> 
> 
>

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index a03e432..26c0fb4 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -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;
         }
     }