summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorManish Rangankar <mrangankar@marvell.com>2020-09-08 12:56:54 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2020-09-09 05:40:23 +0300
commit5a2e69af16cecb30395964e117ba7f0e155a586d (patch)
tree87f84556b1398802ff5f809c077731d2f84b2798 /drivers
parentc0650e28448d606c84f76c34333dba30f61de993 (diff)
downloadlinux-5a2e69af16cecb30395964e117ba7f0e155a586d.tar.xz
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')
-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);