freedreno/a3xx+a4xx: fix potential null ptr deref

Coverity spotted the a3xx case (not sure why not the a4xx).

CID 1362452

Signed-off-by: Rob Clark <robclark@freedesktop.org>
This commit is contained in:
Rob Clark 2016-06-02 11:42:25 -04:00
parent 27a97097e1
commit 9b854ce53c
2 changed files with 4 additions and 2 deletions

View File

@ -79,6 +79,7 @@ emit_mrt(struct fd_ringbuffer *ring, unsigned nr_bufs,
if (rsc->stencil) {
rsc = rsc->stencil;
pformat = rsc->base.b.format;
if (bases)
bases++;
}
slice = fd_resource_slice(rsc, psurf->u.tex.level);

View File

@ -80,6 +80,7 @@ emit_mrt(struct fd_ringbuffer *ring, unsigned nr_bufs,
if (rsc->stencil) {
rsc = rsc->stencil;
pformat = rsc->base.b.format;
if (bases)
bases++;
}