Skip to content

Commit 70facbf

Browse files
JunYe1993davem330
authored andcommitted
mctp: Fix incorrect tx flow invalidation condition in mctp-i2c
Previously, the condition for invalidating the tx flow in mctp_i2c_invalidate_tx_flow() checked if `rc` was nonzero. However, this could incorrectly trigger the invalidation even when `rc > 0` was returned as a success status. This patch updates the condition to explicitly check for `rc < 0`, ensuring that only error cases trigger the invalidation. Signed-off-by: Daniel Hsu <[email protected]> Reviewed-by: Jeremy Kerr <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c7d8291 commit 70facbf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/mctp/mctp-i2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ static void mctp_i2c_xmit(struct mctp_i2c_dev *midev, struct sk_buff *skb)
537537
rc = __i2c_transfer(midev->adapter, &msg, 1);
538538

539539
/* on tx errors, the flow can no longer be considered valid */
540-
if (rc)
540+
if (rc < 0)
541541
mctp_i2c_invalidate_tx_flow(midev, skb);
542542

543543
break;

0 commit comments

Comments
 (0)