gpu: pvr: fix state buffer validation
authorImre Deak <imre.deak@nokia.com>
Tue, 29 Mar 2011 17:30:47 +0000 (20:30 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 20 May 2012 18:43:04 +0000 (21:43 +0300)
The incorrect comparison size could cause a corrupted buffer info to be
regarded as valid.

Reported-by: Coverity
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Reviewed-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
pvr/pvr_debugfs.c

index 9d4fc4c..4a9e068 100644 (file)
@@ -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;
                        }