Fix a potential NULL pointer deref in the aic7xxx, ahc_print_register() function
Subsystems (2)
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.
Signed-off-by Jesper Juhl <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
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
@@ -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 ;
_