public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 08/17] Fix a potential NULL pointer deref in the aic7xxx, ahc_print_register() function
@ 2007-10-02 21:38 akpm
  2007-10-02 22:07 ` James Bottomley
  2007-10-05 21:16 ` James Bottomley
  0 siblings, 2 replies; 4+ messages in thread
From: akpm @ 2007-10-02 21:38 UTC (permalink / raw)
  To: James.Bottomley; +Cc: linux-scsi, akpm, jesper.juhl

From: Jesper Juhl <jesper.juhl@gmail.com>

The Coverity checker noticed that we have a potential NULL pointer
deref in drivers/scsi/aic7xxx/aic7xxx_core.c::ahc_print_register().
This patch handles it by adding the same test against NULL that is
used elsewhere in the same function.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/scsi/aic7xxx/aic7xxx_core.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff -puN drivers/scsi/aic7xxx/aic7xxx_core.c~fix-a-potential-null-pointer-deref-in-the-aic7xxx-ahc_print_register-function drivers/scsi/aic7xxx/aic7xxx_core.c
--- a/drivers/scsi/aic7xxx/aic7xxx_core.c~fix-a-potential-null-pointer-deref-in-the-aic7xxx-ahc_print_register-function
+++ a/drivers/scsi/aic7xxx/aic7xxx_core.c
@@ -6557,7 +6557,8 @@ ahc_print_register(ahc_reg_parse_entry_t
 	printed = printf("%s[0x%x]", name, value);
 	if (table == NULL) {
 		printed += printf(" ");
-		*cur_column += printed;
+		if (cur_column != NULL)
+			*cur_column += printed;
 		return (printed);
 	}
 	printed_mask = 0;
_

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

end of thread, other threads:[~2007-10-05 22:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-02 21:38 [patch 08/17] Fix a potential NULL pointer deref in the aic7xxx, ahc_print_register() function akpm
2007-10-02 22:07 ` James Bottomley
2007-10-05 21:16 ` James Bottomley
2007-10-05 22:23   ` Jesper Juhl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox