video: tegra: host: use dynamically allocated wait_queue rel-24-foster-r2
authorDeepak Nibade <dnibade@nvidia.com>
Wed, 20 Jan 2016 13:39:19 +0000 (18:39 +0530)
committerManish Tuteja <mtuteja@nvidia.com>
Tue, 29 Mar 2016 02:37:52 +0000 (19:37 -0700)
commit62990d85668005a89a2491947444eee887b87567
tree1c6baa0d5ff2a42803564393092cd43abd8f4590
parent9e4bb3e1e345297ff737d9a1f6fc3f288471b448
video: tegra: host: use dynamically allocated wait_queue

In nvhost_syncpt_wait_timeout(), we currently allocate
wait_queue_head on stack using
DECLARE_WAIT_QUEUE_HEAD_ONSTACK()

If wait is complete, then this wait_queue_head will
removed off the stack

But in some rare case if action_wakeup_interruptible()
is called after wait is complete, we try to access
wait_queue_head which is already deleted from stack

To fix this, define wait_queue_head inside nvhost_waitlist
and allocate it dynamically along with waitlist

Bug 200126989

Change-Id: Iad7869323832e6f36c044e0d29fdea62dca762d5
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/935161
(cherry picked from commit 80b5c960e95b9f1f4c1401b03d72641ac4b6ccc6)
Reviewed-on: http://git-master/r/1113381
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinayak Pane <vpane@nvidia.com>
drivers/video/tegra/host/nvhost_intr.c
drivers/video/tegra/host/nvhost_intr.h
drivers/video/tegra/host/nvhost_syncpt.c