]> git.baikalelectronics.ru Git - kernel.git/commit
bnxt_en: Use memcpy to copy VPD field info.
authorVasundhara Volam <vasundhara-v.volam@broadcom.com>
Mon, 21 Sep 2020 01:08:54 +0000 (21:08 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 21 Sep 2020 02:04:44 +0000 (19:04 -0700)
commit254fba264adee53d886584a5be86beaae6cc8e4c
tree7b37c5f337e84a71174bb01a4f09800d09c90ef4
parentfd1dc89b79b62164b68210a4b9ccbac2c938c16b
bnxt_en: Use memcpy to copy VPD field info.

Using strlcpy() to copy from VPD is not correct because VPD strings
are not necessarily NULL terminated.  Use memcpy() to copy the VPD
length up to the destination buffer size - 1.  The destination is
zeroed memory so it will always be NULL terminated.

Fixes: 02bca9679006 ("bnxt_en: Read partno and serialno of the board from VPD")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c