diff options
author | Aingara Paramakuru <aparamakuru@nvidia.com> | 2014-09-05 14:38:21 -0400 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-03-18 15:11:13 -0400 |
commit | ffd25f39055ed76b3d6488ea9d89b65860e56b5a (patch) | |
tree | 49c83fb4020e906b17e18649e2cc2189b1a42183 /drivers/gpu/nvgpu/gk20a | |
parent | 926cd4a2606fb37388ea79d86cde976dda5e08bc (diff) |
gpu: nvgpu: fix crash in gk20a_channel_release
gk20a_channel_release() should bail if filp->private_data is
NULL. This can happen as a result of gk20a_channel_release()
being called when __gk20a_channel_open() fails in
NVHOST_IOCTL_CHANNEL_OPEN.
Bug 200014898
Change-Id: I32cc957aca46fcd4265a8052ac5be355b644b9f7
Signed-off-by: Aingara Paramakuru <aparamakuru@nvidia.com>
Reviewed-on: http://git-master/r/496138
Reviewed-by: Ken Adams <kadams@nvidia.com>
Tested-by: Ken Adams <kadams@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 669ec294..c174afcd 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -708,9 +708,12 @@ unbind: | |||
708 | int gk20a_channel_release(struct inode *inode, struct file *filp) | 708 | int gk20a_channel_release(struct inode *inode, struct file *filp) |
709 | { | 709 | { |
710 | struct channel_gk20a *ch = (struct channel_gk20a *)filp->private_data; | 710 | struct channel_gk20a *ch = (struct channel_gk20a *)filp->private_data; |
711 | struct gk20a *g = ch->g; | 711 | struct gk20a *g = ch ? ch->g : NULL; |
712 | int err; | 712 | int err; |
713 | 713 | ||
714 | if (!ch) | ||
715 | return 0; | ||
716 | |||
714 | trace_gk20a_channel_release(dev_name(&g->dev->dev)); | 717 | trace_gk20a_channel_release(dev_name(&g->dev->dev)); |
715 | 718 | ||
716 | err = gk20a_busy(ch->g->dev); | 719 | err = gk20a_busy(ch->g->dev); |