]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: aic7xxx: aic79xx: fix potential null pointer dereference on ahd
authorColin Ian King <colin.king@canonical.com>
Thu, 31 May 2018 12:31:17 +0000 (13:31 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 8 Jun 2018 01:50:00 +0000 (21:50 -0400)
commit168c7e47a87d4c441d8dc61d170f8a31c773a45a
tree24c0b66ca701328c70fee6435065e152b34a9cdf
parent63334a92c904122aff4454cc120f0d509518a849
scsi: aic7xxx: aic79xx: fix potential null pointer dereference on ahd

If AHD_DEBUG is enabled and ahd_platform_alloc fails then ahd is set to
null and the debug printk dereferences ahd when passing it to ahd_name.
Fix this by moving the debug printk to before the call to
ahd_platform_alloc where ahd is not null at that point.

Detected by CoverityScan, CID#100296 ("Explicit null dereference")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/aic7xxx/aic79xx_core.c