fboverlay: move bpp checks above malloc
Avoids having to free the malloced object. Pointed out by coverity. Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
51ae6126dc
commit
c7fa6a0a0d
|
@ -279,11 +279,11 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen,
|
|||
(&fbOverlayScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
|
||||
return FALSE;
|
||||
|
||||
pScrPriv = malloc(sizeof(FbOverlayScrPrivRec));
|
||||
if (!pScrPriv)
|
||||
if (bpp1 == 24 || bpp2 == 24)
|
||||
return FALSE;
|
||||
|
||||
if (bpp1 == 24 || bpp2 == 24)
|
||||
pScrPriv = malloc(sizeof(FbOverlayScrPrivRec));
|
||||
if (!pScrPriv)
|
||||
return FALSE;
|
||||
|
||||
if (!fbInitVisuals(&visuals, &depths, &nvisuals, &ndepths, &depth1,
|
||||
|
|
Loading…
Reference in New Issue