mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-11 00:08:50 +00:00
drm/radeon/radeon_fence.c: move a dereference below the NULL test
If a NULL value is possible, the dereference should only occur after the NULL test. Coverity CID: 13334 Signed-off-by: Darren Jenkins <darrenrjenkins@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
d8a7f79246
commit
3655d54af8
@ -140,16 +140,15 @@ int radeon_fence_create(struct radeon_device *rdev, struct radeon_fence **fence)
|
|||||||
|
|
||||||
bool radeon_fence_signaled(struct radeon_fence *fence)
|
bool radeon_fence_signaled(struct radeon_fence *fence)
|
||||||
{
|
{
|
||||||
struct radeon_device *rdev = fence->rdev;
|
|
||||||
unsigned long irq_flags;
|
unsigned long irq_flags;
|
||||||
bool signaled = false;
|
bool signaled = false;
|
||||||
|
|
||||||
if (rdev->gpu_lockup) {
|
if (!fence)
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
if (fence == NULL) {
|
if (fence->rdev->gpu_lockup)
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
write_lock_irqsave(&fence->rdev->fence_drv.lock, irq_flags);
|
write_lock_irqsave(&fence->rdev->fence_drv.lock, irq_flags);
|
||||||
signaled = fence->signaled;
|
signaled = fence->signaled;
|
||||||
/* if we are shuting down report all fence as signaled */
|
/* if we are shuting down report all fence as signaled */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user