summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Graul <kgraul@linux.ibm.com>2020-10-02 17:09:27 +0200
committerDavid S. Miller <davem@davemloft.net>2020-10-03 17:04:48 -0700
commitfd6ebb6fb2cf30eb03fbb8949e367832cbb82fec (patch)
treef7ee1d1d9e377c2da3770e58c69ec63631a54a68
parent839d696ffb2714c06da7f55f622d0ac8286524b5 (diff)
downloadlinux-fd6ebb6fb2cf30eb03fbb8949e367832cbb82fec.tar.bz2
net/smc: use an array to check fields in system EID
The check for old hardware versions that did not have SMCDv2 support was using suspicious pointer magic. Address the fields using an array. Signed-off-by: Karsten Graul <kgraul@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/smc/smc_ism.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/smc/smc_ism.c b/net/smc/smc_ism.c
index e9a6487a42cb..6abbdd09a580 100644
--- a/net/smc/smc_ism.c
+++ b/net/smc/smc_ism.c
@@ -335,7 +335,7 @@ int smcd_register_dev(struct smcd_dev *smcd)
u8 *system_eid = NULL;
smc_ism_get_system_eid(smcd, &system_eid);
- if ((*system_eid) + 24 != '0' || (*system_eid) + 28 != '0')
+ if (system_eid[24] != '0' || system_eid[28] != '0')
smc_ism_v2_capable = true;
}
/* sort list: devices without pnetid before devices with pnetid */