Make it clearer to Coverity that there's no array overrun.
CID 989067
This commit is contained in:
parent
233c08f603
commit
6cf42677a6
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: nouveau_engine_disp_nvd0.c,v 1.2 2014/08/23 08:03:33 riastradh Exp $ */
|
||||
/* $NetBSD: nouveau_engine_disp_nvd0.c,v 1.3 2016/04/23 14:59:01 riastradh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2012 Red Hat Inc.
|
||||
|
@ -25,7 +25,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: nouveau_engine_disp_nvd0.c,v 1.2 2014/08/23 08:03:33 riastradh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: nouveau_engine_disp_nvd0.c,v 1.3 2016/04/23 14:59:01 riastradh Exp $");
|
||||
|
||||
#include <core/object.h>
|
||||
#include <core/parent.h>
|
||||
|
@ -1042,7 +1042,8 @@ exec_clkcmp(struct nv50_disp_priv *priv, int head, int id,
|
|||
}
|
||||
|
||||
data = nvbios_ocfg_match(bios, data, conf, &ver, &hdr, &cnt, &len, &info2);
|
||||
if (data && id < 0xff) {
|
||||
CTASSERT(__arraycount(info2.clkcmp) <= 0xff);
|
||||
if (data && id < __arraycount(info2.clkcmp)) {
|
||||
data = nvbios_oclk_match(bios, info2.clkcmp[id], pclk);
|
||||
if (data) {
|
||||
struct nvbios_init init = {
|
||||
|
|
Loading…
Reference in New Issue