From: Imre Deak Date: Tue, 29 Mar 2011 17:30:47 +0000 (+0300) Subject: gpu: pvr: fix state buffer validation X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=315afd65a21be0073014175356885363aaa97d6e;p=sgx.git gpu: pvr: fix state buffer validation The incorrect comparison size could cause a corrupted buffer info to be regarded as valid. Reported-by: Coverity Signed-off-by: Imre Deak Reviewed-by: Pauli Nieminen --- diff --git a/pvr/pvr_debugfs.c b/pvr/pvr_debugfs.c index 9d4fc4c..4a9e068 100644 --- a/pvr/pvr_debugfs.c +++ b/pvr/pvr_debugfs.c @@ -413,7 +413,8 @@ static void add_uniq_items(struct render_state_buf_list *dst, for (j = 0; j < dst->cnt; j++) { if (sbinf->buf_id == dst->info[j].buf_id) { - if (memcmp(sbinf, &dst->info[j], sizeof(sbinf))) + if (memcmp(sbinf, &dst->info[j], + sizeof(*sbinf))) dst->info[j].type |= BUF_DESC_CORRUPT; break; }