From 315afd65a21be0073014175356885363aaa97d6e Mon Sep 17 00:00:00 2001 From: Imre Deak Date: Tue, 29 Mar 2011 20:30:47 +0300 Subject: [PATCH] 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 --- pvr/pvr_debugfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- 2.39.5