Commit 5a2e69af authored by Manish Rangankar's avatar Manish Rangankar Committed by Martin K. Petersen

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.comSigned-off-by: default avatarManish Rangankar <mrangankar@marvell.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent c0650e28
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment