diff options
| author | Ian Bridges <icb@fastmail.org> | 2026-07-29 09:46:14 -0500 |
|---|---|---|
| committer | Martin K. Petersen (Oracle) <mkp@kernel.org> | 2026-08-13 22:15:22 -0400 |
| commit | 07f46a9f8964b91d56951ef7f74c551af0eddeac (patch) | |
| tree | 023f0e02f20e072c09dd9e685119328357014ea3 /scripts/objdiff | |
| parent | 5a03dbfd670092a6960de433005aae1734c18f1f (diff) | |
| download | linux-next-07f46a9f8964b91d56951ef7f74c551af0eddeac.tar.gz linux-next-07f46a9f8964b91d56951ef7f74c551af0eddeac.zip | |
scsi: lpfc: Replace strlcat() with scnprintf() in lpfc_vport_symbolic_node_name()
In preparation for removing the strlcat() API[1], replace its uses in
lpfc_vport_symbolic_node_name().
The function builds five unconditional fragments, so one scnprintf()
call composes the whole string. The intermediate tmp buffer and the per
fragment overflow checks become unnecessary. scnprintf() truncates at
the buffer size and returns the number of bytes it wrote, which equals
the length that the removed strnlen() call computed.
The old code capped every fragment at MAXHOSTNAMELEN bytes before
appending it, independently of the room left in the destination. The
replacement formats each fragment directly into the destination, so a
fragment longer than MAXHOSTNAMELEN is no longer truncated when the
destination has room for it.
Link: https://github.com/KSPP/linux/issues/370 [1]
Signed-off-by: Ian Bridges <icb@fastmail.org>
Link: https://patch.msgid.link/20260729144617.1388646-3-icb@fastmail.org
Reviewed-by: Nigel Kirkland <nigel.kirkland@broadcom.com>
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Diffstat (limited to 'scripts/objdiff')
0 files changed, 0 insertions, 0 deletions
