Skip to content

Commit

Permalink
net: fec: replace snprintf() with strlcpy() in fec_ptp_init()
Browse files Browse the repository at this point in the history
No need to use snprintf() on a constant string, nor using magic
constant in the fixed code was a good idea.

Signed-off-by: Sergey Organov <sorganov@gmail.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Sergey Organov authored and Jakub Kicinski committed Jul 16, 2020
1 parent 2b80308 commit 31bb1a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/freescale/fec_ptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ void fec_ptp_init(struct platform_device *pdev, int irq_idx)
int ret;

fep->ptp_caps.owner = THIS_MODULE;
snprintf(fep->ptp_caps.name, 16, "fec ptp");
strlcpy(fep->ptp_caps.name, "fec ptp", sizeof(fep->ptp_caps.name));

fep->ptp_caps.max_adj = 250000000;
fep->ptp_caps.n_alarm = 0;
Expand Down

0 comments on commit 31bb1a5

Please sign in to comment.