From aee09871fac7685c7a981b7271af89f2c18dae14 Mon Sep 17 00:00:00 2001 From: chris Date: Sat, 18 Mar 2006 18:44:16 +0000 Subject: [PATCH] Fix eeprom == NULL and size test. Fixes Coverity CID 1109: (sc)->eeprom_data tracked as NULL was dereferenced. --- sys/dev/ic/cs89x0.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/ic/cs89x0.c b/sys/dev/ic/cs89x0.c index a3dea967f60a..b8ee2bbfe6d2 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 -__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); /*