mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-03 20:34:23 -04:00
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>
This commit is contained in:
committed by
Martin K. Petersen
parent
c0650e2844
commit
5a2e69af16
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user