summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qedi
diff options
context:
space:
mode:
authorManish Rangankar <mrangankar@marvell.com>2020-09-08 11:56:54 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2020-09-09 04:40:23 +0200
commit5a2e69af16cecb30395964e117ba7f0e155a586d (patch)
tree87f84556b1398802ff5f809c077731d2f84b2798 /drivers/scsi/qedi
parentscsi: qedi: Protect active command list to avoid list corruption (diff)
downloadlinux-5a2e69af16cecb30395964e117ba7f0e155a586d.tar.xz
linux-5a2e69af16cecb30395964e117ba7f0e155a586d.zip
scsi: qedi: Use snprintf instead of sprintf
Use snprintf to limit max number of bytes to the buffer. Link: https://lore.kernel.org/r/20200908095657.26821-6-mrangankar@marvell.com Signed-off-by: Manish Rangankar <mrangankar@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qedi')
-rw-r--r--drivers/scsi/qedi/qedi_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c
index c6842af1f21b..15b78e1783c2 100644
--- a/drivers/scsi/qedi/qedi_main.c
+++ b/drivers/scsi/qedi/qedi_main.c
@@ -2537,7 +2537,7 @@ static int __qedi_probe(struct pci_dev *pdev, int mode)
QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_DISC, "MAC address is %pM.\n",
qedi->mac);
- sprintf(host_buf, "host_%d", qedi->shost->host_no);
+ snprintf(host_buf, sizeof(host_buf), "host_%d", qedi->shost->host_no);
qedi_ops->common->set_name(qedi->cdev, host_buf);
qedi_ops->register_ops(qedi->cdev, &qedi_cb_ops, qedi);