All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] [SCSI] aic79xx: NULL dereference in debug code
@ 2012-07-20 11:30 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2012-07-20 11:30 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: James E.J. Bottomley, linux-scsi, linux-kernel, kernel-janitors

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

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c
index 25417d0..5db8925 100644
--- a/drivers/scsi/aic7xxx/aic79xx_core.c
+++ b/drivers/scsi/aic7xxx/aic79xx_core.c
@@ -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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [patch] [SCSI] aic79xx: NULL dereference in debug code
@ 2012-07-20 11:30 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2012-07-20 11:30 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: James E.J. Bottomley, linux-scsi, linux-kernel, kernel-janitors

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

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c
index 25417d0..5db8925 100644
--- a/drivers/scsi/aic7xxx/aic79xx_core.c
+++ b/drivers/scsi/aic7xxx/aic79xx_core.c
@@ -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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [patch] [SCSI] aic79xx: NULL dereference in debug code
  2012-07-20 11:30 ` Dan Carpenter
@ 2012-07-20 14:41   ` Hannes Reinecke
  -1 siblings, 0 replies; 4+ messages in thread
From: Hannes Reinecke @ 2012-07-20 14:41 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: James E.J. Bottomley, linux-scsi, linux-kernel, kernel-janitors

On 07/20/2012 01:30 PM, Dan Carpenter wrote:
> "ahd" can be NULL here and it gets dereferenced inside the call to
> ahd_name().
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
Acked-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] [SCSI] aic79xx: NULL dereference in debug code
@ 2012-07-20 14:41   ` Hannes Reinecke
  0 siblings, 0 replies; 4+ messages in thread
From: Hannes Reinecke @ 2012-07-20 14:41 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: James E.J. Bottomley, linux-scsi, linux-kernel, kernel-janitors

On 07/20/2012 01:30 PM, Dan Carpenter wrote:
> "ahd" can be NULL here and it gets dereferenced inside the call to
> ahd_name().
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
Acked-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +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)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-07-20 14:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-20 11:30 [patch] [SCSI] aic79xx: NULL dereference in debug code Dan Carpenter
2012-07-20 11:30 ` Dan Carpenter
2012-07-20 14:41 ` Hannes Reinecke
2012-07-20 14:41   ` Hannes Reinecke

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.