Skip to contentSkip to conversation

aic79xx: NULL dereference in debug code

PATCH In review Dan Carpenter 2 participants 2 messages Jul 20, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 aic79xx: NULL dereference in debug code

"ahd" can be NULL here and it gets dereferenced inside the call to ahd_name().

drivers/scsi/aic7xxx/aic79xx_core.c +2 -1
index 25417d0..5db8925 100644
@@ -6120,7 +6120,8 @@ ahd_alloc(void *platform_arg, char *name)
 #ifdef AHD_DEBUG
 	if ((ahd_debug & AHD_SHOW_MEMORY) != 0) {
 		printk("%s: scb size = 0x%x, hscb size = 0x%x\n",
-		       ahd_name(ahd), (u_int)sizeof(struct scb),
+		       ahd ? ahd_name(ahd) : "(null)",
+		       (u_int)sizeof(struct scb),
 		       (u_int)sizeof(struct hardware_scb));
 	}
 #endif
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Dan Carpenter

"ahd" can be NULL here and it gets dereferenced inside the call to ahd_name().

Cheers,

Hannes

Signature · 10 lines
Dr. Hannes Reinecke		      zSeries & Storage
[email protected]			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)


--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html