mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
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>
This commit is contained in:
committed by
Dan Willemsen
parent
926cd4a260
commit
ffd25f3905
@@ -708,9 +708,12 @@ unbind:
|
|||||||
int gk20a_channel_release(struct inode *inode, struct file *filp)
|
int gk20a_channel_release(struct inode *inode, struct file *filp)
|
||||||
{
|
{
|
||||||
struct channel_gk20a *ch = (struct channel_gk20a *)filp->private_data;
|
struct channel_gk20a *ch = (struct channel_gk20a *)filp->private_data;
|
||||||
struct gk20a *g = ch->g;
|
struct gk20a *g = ch ? ch->g : NULL;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
if (!ch)
|
||||||
|
return 0;
|
||||||
|
|
||||||
trace_gk20a_channel_release(dev_name(&g->dev->dev));
|
trace_gk20a_channel_release(dev_name(&g->dev->dev));
|
||||||
|
|
||||||
err = gk20a_busy(ch->g->dev);
|
err = gk20a_busy(ch->g->dev);
|
||||||
|
|||||||
Reference in New Issue
Block a user