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>
(cherry picked from commit c7fa6a0a0d
)
This commit is contained in:
parent
26a83f9833
commit
bb384d0b11
|
@ -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