scsi: advansys: Fix kernel pointer leak
authorGuo Zhi <qtxuning1999@sjtu.edu.cn>
Wed, 29 Sep 2021 12:25:37 +0000 (20:25 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Nov 2021 08:48:27 +0000 (09:48 +0100)
[ Upstream commit d4996c6eac4c81b8872043e9391563f67f13e406 ]

Pointers should be printed with %p or %px rather than cast to 'unsigned
long' and printed with %lx.

Change %lx to %p to print the hashed pointer.

Link: https://lore.kernel.org/r/20210929122538.1158235-1-qtxuning1999@sjtu.edu.cn
Signed-off-by: Guo Zhi <qtxuning1999@sjtu.edu.cn>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/advansys.c

index ffb391967573489fd8f44b16d64d04c58af0dd71..97be0765cb9bd04bb8fe5cc4eff4273309457a05 100644 (file)
@@ -3308,8 +3308,8 @@ static void asc_prt_adv_board_info(struct seq_file *m, struct Scsi_Host *shost)
                   shost->host_no);
 
        seq_printf(m,
-                  " iop_base 0x%lx, cable_detect: %X, err_code %u\n",
-                  (unsigned long)v->iop_base,
+                  " iop_base 0x%p, cable_detect: %X, err_code %u\n",
+                  v->iop_base,
                   AdvReadWordRegister(iop_base,IOPW_SCSI_CFG1) & CABLE_DETECT,
                   v->err_code);