Skip to contentSkip to conversation

Fix a potential NULL pointer deref in the aic7xxx, ahc_print_register() function

PATCH NAK [email protected] 1 participant 1 message Aug 10, 2007

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

PATCH 28/30 Fix a potential NULL pointer deref in the aic7xxx, ahc_print_register() function

From: Jesper Juhl <[email protected]>

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.

---

 drivers/scsi/aic7xxx/aic7xxx_core.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/aic7xxx/aic7xxx_core.c renamed from drivers/scsi/aic7xxx/aic7xxx_core.c~fix-a-potential-null-pointer-deref-in-the-aic7xxx-ahc_print_register-function +2 -1
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
@@ -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;

_