Skip to contentSkip to conversation

infiniband:cxgb4:Fix if statement check in the function pick_local_ip6adddrs

PATCH Applied Steve Wise 2 participants 2 messages Aug 27, 2015 – Sep 3, 2015 1 message not in the archive InfiniBand

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Applied
#2 lore raw
In reply to a message not in the archive
Quoted 8 lines · Nicholas Krause

This fixes a if statement checking the return value of the function get_lladdr for success in the function pick_local_ip6addrs to instead of directly checking the return value of this call check the opposite as get_lladdr returns zero for success which would incorrectly make this if statement block not execute with the current if statement check.

Thanks, applied.

Quoted 18 lines
---
 drivers/infiniband/hw/cxgb4/cm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/cxgb4/cm.c +1 -1
index 3ad8dc7..b85b94b 100644
@@ -2976,7 +2976,7 @@ static int pick_local_ip6addrs(struct c4iw_dev *dev, struct iw_cm_id *cm_id)
 	struct sockaddr_in6 *la6 = (struct sockaddr_in6 *)&cm_id->local_addr;
 	struct sockaddr_in6 *ra6 = (struct sockaddr_in6 *)&cm_id->remote_addr;
 
-	if (get_lladdr(dev->rdev.lldi.ports[0], &addr, IFA_F_TENTATIVE)) {
+	if (!get_lladdr(dev->rdev.lldi.ports[0], &addr, IFA_F_TENTATIVE)) {
 		memcpy(la6->sin6_addr.s6_addr, &addr, 16);
 		memcpy(ra6->sin6_addr.s6_addr, &addr, 16);
 		return 0;
Signature · 2 lines
Doug Ledford <[email protected]>
              GPG KeyID: 0E572FDD