mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
gpu: nvgpu: check for null pointer access
It is possible to have an invalid combination of the ioctl calls that could result in a null pointer access in the function gk20a_event_id_release(). The null pointer access can be prevented by having a null check for a valid struct gk20a_event_id_data before accessing its internal variables. Bug 200462170 Change-Id: I9233479081b7a7659deeaa3b84141381ed302e63 Signed-off-by: Debarshi Dutta <ddutta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2006314 Reviewed-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
9578ed6c4e
commit
2217e342d5
@@ -256,8 +256,14 @@ static unsigned int gk20a_event_id_poll(struct file *filep, poll_table *wait)
|
||||
static int gk20a_event_id_release(struct inode *inode, struct file *filp)
|
||||
{
|
||||
struct gk20a_event_id_data *event_id_data = filp->private_data;
|
||||
struct gk20a *g = event_id_data->g;
|
||||
struct tsg_gk20a *tsg = g->fifo.tsg + event_id_data->id;
|
||||
struct gk20a *g;
|
||||
struct tsg_gk20a *tsg;
|
||||
|
||||
if (event_id_data == NULL)
|
||||
return -EINVAL;
|
||||
|
||||
g = event_id_data->g;
|
||||
tsg = g->fifo.tsg + event_id_data->id;
|
||||
|
||||
nvgpu_mutex_acquire(&tsg->event_id_list_lock);
|
||||
nvgpu_list_del(&event_id_data->event_id_node);
|
||||
|
||||
Reference in New Issue
Block a user