fix potential null ptr deref

Submitted by:	Coverity Prevent analysis tool
This commit is contained in:
Sam Leffler 2005-03-29 01:44:59 +00:00
parent 14d15addab
commit b083b7c98d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=144263

View File

@ -2292,10 +2292,6 @@ dump_db(struct fwohci_softc *sc, uint32_t ch)
pp = dbch->top; pp = dbch->top;
prev = pp->db; prev = pp->db;
for(idb = 0 ; idb < dbch->ndb ; idb ++ ){ for(idb = 0 ; idb < dbch->ndb ; idb ++ ){
if(pp == NULL){
curr = NULL;
goto outdb;
}
cp = STAILQ_NEXT(pp, link); cp = STAILQ_NEXT(pp, link);
if(cp == NULL){ if(cp == NULL){
curr = NULL; curr = NULL;
@ -2314,6 +2310,10 @@ dump_db(struct fwohci_softc *sc, uint32_t ch)
} }
} }
pp = STAILQ_NEXT(pp, link); pp = STAILQ_NEXT(pp, link);
if(pp == NULL){
curr = NULL;
goto outdb;
}
prev = pp->db; prev = pp->db;
} }
outdb: outdb: