bnx2x: Fix firmware version string character counts
[sfrench/cifs-2.6.git] / drivers / net / ethernet / broadcom / bnx2x / bnx2x_cmn.c
index e9c1e1bb5580601de46de29c7967d44ad39c260d..528441b28c4efe73eae5aa366c66b5ef8cc35ef2 100644 (file)
@@ -147,10 +147,11 @@ void bnx2x_fill_fw_str(struct bnx2x *bp, char *buf, size_t buf_len)
 
                phy_fw_ver[0] = '\0';
                bnx2x_get_ext_phy_fw_version(&bp->link_params,
-                                            phy_fw_ver, PHY_FW_VER_LEN);
-               strscpy(buf, bp->fw_ver, buf_len);
-               snprintf(buf + strlen(bp->fw_ver), 32 - strlen(bp->fw_ver),
-                        "bc %d.%d.%d%s%s",
+                                            phy_fw_ver, sizeof(phy_fw_ver));
+               /* This may become truncated. */
+               scnprintf(buf, buf_len,
+                        "%sbc %d.%d.%d%s%s",
+                        bp->fw_ver,
                         (bp->common.bc_ver & 0xff0000) >> 16,
                         (bp->common.bc_ver & 0xff00) >> 8,
                         (bp->common.bc_ver & 0xff),