From: Daniel Hsu Date: Tue, 25 Mar 2025 08:10:08 +0000 (+0800) Subject: mctp: Fix incorrect tx flow invalidation condition in mctp-i2c X-Git-Tag: io_uring-6.15-20250403~82^2^2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=70facbf978ac90c6da17a3de2a8dd111b06f1bac;p=linux-block.git 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 Reviewed-by: Jeremy Kerr Signed-off-by: David S. Miller --- diff --git a/drivers/net/mctp/mctp-i2c.c b/drivers/net/mctp/mctp-i2c.c index d74d47dd6e04..f782d93f826e 100644 --- a/drivers/net/mctp/mctp-i2c.c +++ b/drivers/net/mctp/mctp-i2c.c @@ -537,7 +537,7 @@ static void mctp_i2c_xmit(struct mctp_i2c_dev *midev, struct sk_buff *skb) rc = __i2c_transfer(midev->adapter, &msg, 1); /* on tx errors, the flow can no longer be considered valid */ - if (rc) + if (rc < 0) mctp_i2c_invalidate_tx_flow(midev, skb); break;