Avoid possible null pointer dereference.
Found by Coverity, CID 709895.
This commit is contained in:
parent
8a7283ac4d
commit
98bea04d22
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: nouveau_subdev_mxm_mxms.c,v 1.1.1.1 2014/08/06 12:36:31 riastradh Exp $ */
|
||||
/* $NetBSD: nouveau_subdev_mxm_mxms.c,v 1.2 2016/04/22 19:40:55 riastradh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2012 Red Hat Inc.
|
||||
|
@ -25,7 +25,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: nouveau_subdev_mxm_mxms.c,v 1.1.1.1 2014/08/06 12:36:31 riastradh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: nouveau_subdev_mxm_mxms.c,v 1.2 2016/04/22 19:40:55 riastradh Exp $");
|
||||
|
||||
#include <subdev/mxm.h>
|
||||
#include "mxms.h"
|
||||
|
@ -173,7 +173,7 @@ mxms_foreach(struct nouveau_mxm *mxm, u8 types,
|
|||
}
|
||||
}
|
||||
|
||||
if (types & (1 << type)) {
|
||||
if ((types & (1 << type)) && (exec != NULL)) {
|
||||
if (!exec(mxm, desc, info))
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue