summaryrefslogtreecommitdiff
path: root/include/uapi
diff options
context:
space:
mode:
authorSubhash Jadavani <subhashj@codeaurora.org>2015-01-25 15:06:37 -0800
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:00:56 -0700
commitedf4a84a0b60800e7195fdf140eb93241726e09e (patch)
tree79cef8d18f5b44c4a843bb9b838f2bd6ea9c041c /include/uapi
parentc6b82e8bca9a579ddf894efa69c222f2c373309c (diff)
scsi: pm: fix null pointer access during sg_open
When user space application opens any scsi generic device node (/dev/sg*), we will have following call stack: -> sg_open() -> scsi_autopm_get_device() -> pm_runtime_get_sync() -> scsi_runtime_resume() -> sdev_runtime_resume() -> blk_post_runtime_resume() The request queue device pointer (q->dev) is deferenced but it is NULL. q->dev is assigned when blk_pm_runtime_init() is called which only takes place for sd/sr type scsi devices. SCSI generic driver handles runtime PM get/put on its instead of block layer handling it. We can move the runtime PM get/put responsibility to block layer only if all the requests handled by sg driver are getting inserted to block layer request queue but this is not always true. For example, if LLD ioctl is issued via scsi generic ioctl then it may not get converted to block layer request (and hence doesn't get inserted into block layer request queue) and this may put us in situation where LLD driver handler the ioctl when it's runtime suspended. Better solution would be to let the sg driver manage its own runtime PM get/sync operations and fix the broken scsi_runtime_suspend and scsi_runtime_resume callbacks to handle SCSI devices which do not have upper layer driver (like SCSI disk). Change-Id: I1cae7f992f21a1c420d38c275a817d06baa8923d Signed-off-by: Gilad Broner <gbroner@codeaurora.org> [subhashj@codeaurora.org: fixed the compilation failure] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [venkatg@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
Diffstat (limited to 'include/uapi')
0 files changed, 0 insertions, 0 deletions