]> git.baikalelectronics.ru Git - kernel.git/commit
drm/nouveau/instmem/gk20a: fix crash during error path
authorAlexandre Courbot <acourbot@nvidia.com>
Tue, 10 Mar 2015 06:46:08 +0000 (15:46 +0900)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 14 Apr 2015 07:00:49 +0000 (17:00 +1000)
commitc82c07dd16c4a3c18821eae1c0e217778d8e5a4b
tree0de2d391eee6fc2ade05bdaeedbdcfdb9558a7d6
parent3b9538c48754fbfa28f42ed214fb431308b1b86c
drm/nouveau/instmem/gk20a: fix crash during error path

If a memory allocation fails when using the DMA allocator,
gk20a_instobj_dtor_dma() will be called on the failed instmem object.
At this time, node->handle might not be NULL despite the call to
dma_alloc_attrs() having failed. node->cpuaddr is the right member to
check for such a failure, so use it instead.

Reported-by: Vince Hsu <vinceh@nvidia.com>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c