Commit 492adcf
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: a0d0fd7 ("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>1 parent fe81d9f commit 492adcf
1 file changed
+5
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12090 | 12090 | | |
12091 | 12091 | | |
12092 | 12092 | | |
12093 | | - | |
| 12093 | + | |
12094 | 12094 | | |
12095 | 12095 | | |
12096 | 12096 | | |
| |||
12125 | 12125 | | |
12126 | 12126 | | |
12127 | 12127 | | |
12128 | | - | |
| 12128 | + | |
| 12129 | + | |
12129 | 12130 | | |
12130 | 12131 | | |
12131 | 12132 | | |
| |||
12138 | 12139 | | |
12139 | 12140 | | |
12140 | 12141 | | |
12141 | | - | |
| 12142 | + | |
| 12143 | + | |
12142 | 12144 | | |
12143 | 12145 | | |
12144 | 12146 | | |
| |||
0 commit comments