You need to sign in or sign up before continuing.
  • Andrew Morton's avatar
    [PATCH] do_write_mem() return value check · 055a54db
    Andrew Morton authored
    From: BlaisorBlade <blaisorblade_spam@yahoo.it>, and me
    
    - remove unused `file *' arg from do_write_mem()
    
    - Add checking for copy_from_user() failures in do_write_mem()
    
    - Return correct value from kmem writes() when a fault is encountered.  A
      write()-style syscall's return values are:
    
       0 when nothing was written and there was no error (someone tried to
       write zero bytes)
    
       >0: the number of bytes copied, whether or not there was an error.
       Userspace detects errors by noting that the write() return value is less
       than was requested.
    
       <0: there was an error and no bytes were copied
    055a54db
mem.c 16.3 KB