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
  • drivers
  • input
  • joydev.c
Find file BlameHistoryPermalink
  • Javier Martinez Canillas's avatar
    Input: joydev - fix possible ERR_PTR() dereferencing · 5b21e3c7
    Javier Martinez Canillas authored Oct 06, 2015
    Commit 5702222c ("Input: joydev - use memdup_user() to duplicate
    memory from user-space") changed the kmalloc() and copy_from_user()
    with a single call to memdup_user() but wrongly used the same error
    path than the old code in which the buffer allocated by kmalloc() was
    freed if copy_from_user() failed.
    
    This is of course wrong since if memdup_user() fails, no memory was
    allocated and the error in the error-valued pointer should be returned.
    
    Fixes: 5702222c
    
     ("Input: joydev - use memdup_user() to duplicate
    memory from user-space")
    Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
    Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
    5b21e3c7
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7