Skip to contentSkip to conversation

Deref in drivers/block/paride/pf.c

PATCH New Eric Sesterhenn 1 participant 1 message Jun 28, 2006 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Deref in drivers/block/paride/pf.c

hi,

another possible dereference detected by
coverity (id #759). pf_probe() might call
pf_identify() which might call get_capacity()
which dereferences pf->disk

drivers/block/paride/pf.c renamed from drivers/block/paride/pf.c.orig +1 -1
@@ -707,7 +707,7 @@ static int pf_detect(void)
 			if (pi_init(pf->pi, 0, conf[D_PRT], conf[D_MOD],
 				    conf[D_UNI], conf[D_PRO], conf[D_DLY],
 				    pf_scratch, PI_PF, verbose, pf->name)) {
-				if (!pf_probe(pf) && pf->disk) {
+				if (pf->disk && !pf_probe(pf)) {
 					pf->present = 1;
 					k++;
 				} else