mirror of
https://github.com/X11Libre/xf86-video-ati.git
synced 2026-03-24 01:24:43 +00:00
Fix uninitialized use of local variable pitch in radeon_setup_kernel_mem
Fixes server reset.
Pointed out by clang:
../../src/radeon_kms.c:2721:9: warning: variable 'pitch' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (!info->front_buffer) {
^~~~~~~~~~~~~~~~~~~
../../src/radeon_kms.c:2765:27: note: uninitialized use occurs here
pScrn->displayWidth = pitch / cpp;
^~~~~
This commit is contained in:
committed by
Michel Dänzer
parent
5d5d883496
commit
2d58830c3f
@@ -2760,10 +2760,11 @@ static Bool radeon_setup_kernel_mem(ScreenPtr pScreen)
|
|||||||
if (tiling_flags)
|
if (tiling_flags)
|
||||||
radeon_bo_set_tiling(info->front_buffer->bo.radeon, tiling_flags, pitch);
|
radeon_bo_set_tiling(info->front_buffer->bo.radeon, tiling_flags, pitch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pScrn->displayWidth = pitch / cpp;
|
||||||
}
|
}
|
||||||
|
|
||||||
pScrn->displayWidth = pitch / cpp;
|
pitch = pScrn->displayWidth * cpp;
|
||||||
|
|
||||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Front buffer size: %dK\n",
|
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Front buffer size: %dK\n",
|
||||||
pitch * pScrn->virtualY / 1024);
|
pitch * pScrn->virtualY / 1024);
|
||||||
radeon_kms_update_vram_limit(pScrn, pitch * pScrn->virtualY);
|
radeon_kms_update_vram_limit(pScrn, pitch * pScrn->virtualY);
|
||||||
|
|||||||
Reference in New Issue
Block a user