Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • L linux-dm
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • linux-arm
  • linux-dm
  • Repository
Switch branch/tag
  • linux-dm
  • drivers
  • scsi
  • scsi_lib.c
Find file BlameHistoryPermalink
  • Christoph Hellwig's avatar
    scsi: core: fix the dma_max_mapping_size call · 1b5d9a6e
    Christoph Hellwig authored Jul 22, 2019
    We should only call dma_max_mapping_size for devices that have a DMA mask
    set, otherwise we can run into a NULL pointer dereference that will crash
    the system.
    
    Also we need to do right shift to get the sectors from the size in bytes,
    not a left shift.
    
    Fixes: bdd17bde
    
     ("scsi: core: take the DMA max mapping size into account")
    Reported-by: default avatarBart Van Assche <bvanassche@acm.org>
    Reported-by: default avatarMing Lei <tom.leiming@gmail.com>
    Tested-by: default avatarGuilherme G. Piccoli <gpiccoli@canonical.com>
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    1b5d9a6e