summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorchris <chris@NetBSD.org>2006-03-18 18:44:16 +0000
committerchris <chris@NetBSD.org>2006-03-18 18:44:16 +0000
commitaee09871fac7685c7a981b7271af89f2c18dae14 (patch)
treea3cb01a0f55ec574717186dd88668f8b3d4905da /sys/dev
parenta7fb3cd24118577d64a8e7c2d1399d442c8c0928 (diff)
Fix eeprom == NULL and size test.
Fixes Coverity CID 1109: (sc)->eeprom_data tracked as NULL was dereferenced.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/cs89x0.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/ic/cs89x0.c b/sys/dev/ic/cs89x0.c
index a3dea967f60..b8ee2bbfe6d 100644
--- a/sys/dev/ic/cs89x0.c
+++ b/sys/dev/ic/cs89x0.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cs89x0.c,v 1.18 2005/12/11 12:21:26 christos Exp $ */
+/* $NetBSD: cs89x0.c,v 1.19 2006/03/18 18:44:16 chris Exp $ */
/*
* Copyright (c) 2004 Christopher Gilbert
@@ -212,7 +212,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cs89x0.c,v 1.18 2005/12/11 12:21:26 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cs89x0.c,v 1.19 2006/03/18 18:44:16 chris Exp $");
#include "opt_inet.h"
@@ -684,7 +684,7 @@ cs_read_pktpg_from_eeprom(struct cs_softc *sc, int pktpg, u_int16_t *pValue)
int x, maxword;
/* Check that we have eeprom data */
- if (sc->eeprom_data == NULL && (sc->eeprom_size > 2))
+ if ((sc->eeprom_data == NULL) || (sc->eeprom_size < 2))
return (CS_ERROR);
/*