Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • kernel
  • fork.c
Find file BlameHistoryPermalink
  • Oleg Nesterov's avatar
    fork/exit: move tty_kref_put() outside of __cleanup_signal() · 4dec2a91
    Oleg Nesterov authored May 26, 2010
    
    
    tty_kref_put() has two callsites in copy_process() paths,
    
    	1. if copy_process() suceeds it is called before we copy
    	   signal->tty from parent
    
    	2. otherwise it is called from __cleanup_signal() under
    	   bad_fork_cleanup_signal: label
    
    In both cases tty_kref_put() is not right and unneeded because we don't
    have the balancing tty_kref_get().  Fortunately, this is harmless because
    this can only happen without CLONE_THREAD, and in this case signal->tty
    must be NULL.
    
    Remove tty_kref_put() from copy_process() and __cleanup_signal(), and
    change another caller of __cleanup_signal(), __exit_signal(), to call
    tty_kref_put() by hand.
    
    I hope this change makes sense by itself, but it is also needed to make
    ->signal refcountable.
    
    Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
    Acked-by: default avatarAlan Cox <alan@linux.intel.com>
    Acked-by: default avatarRoland McGrath <roland@redhat.com>
    Cc: Greg KH <greg@kroah.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    4dec2a91
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7