From dc6d6d34e1f674b39d91454fca2b826e190e0351 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 8 Aug 2019 20:01:55 -0700 Subject: scsi: qla2xxx: Check the PCI info string output buffer size Pass the output buffer size to the code that generates a PCI info string and check the output buffer size while generating a PCI info string. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche Tested-by: Himanshu Madhani Reviewed-by: Himanshu Madhani Signed-off-by: Martin K. Petersen --- drivers/scsi/qla2xxx/qla_mr.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'drivers/scsi/qla2xxx/qla_mr.c') diff --git a/drivers/scsi/qla2xxx/qla_mr.c b/drivers/scsi/qla2xxx/qla_mr.c index 9e3f2f462a2e..759fcfecc310 100644 --- a/drivers/scsi/qla2xxx/qla_mr.c +++ b/drivers/scsi/qla2xxx/qla_mr.c @@ -688,14 +688,12 @@ qlafx00_config_rings(struct scsi_qla_host *vha) } char * -qlafx00_pci_info_str(struct scsi_qla_host *vha, char *str) +qlafx00_pci_info_str(struct scsi_qla_host *vha, char *str, size_t str_len) { struct qla_hw_data *ha = vha->hw; - if (pci_is_pcie(ha->pdev)) { - strcpy(str, "PCIe iSA"); - return str; - } + if (pci_is_pcie(ha->pdev)) + strlcpy(str, "PCIe iSA", str_len); return str; } -- cgit v1.2.3