IB/cma: Add a missing rcu_read_unlock()
PATCH 1/1 IB/cma: Add a missing rcu_read_unlock()
Ensure that validate_ipv4_net_dev() calls rcu_read_unlock() if fib_lookup() fails. Detected by sparse. Compile-tested only.
--- drivers/infiniband/core/cma.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/infiniband/core/cma.c +1 -4
@@ -1126,10 +1126,7 @@ static bool validate_ipv4_net_dev(struct net_device *net_dev,rcu_read_lock (); err =fib_lookup (dev_net (net_dev), &fl4, &res,0 ); -if (err) -return false; - - ret =FIB_RES_DEV (res) == net_dev; + ret = err ==0 &&FIB_RES_DEV (res) == net_dev;rcu_read_unlock ();return ret;
Signature · 6 lines
2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Sagi Grimberg
Reviewed-byQuoted 7 lines
Ensure that
validate_ipv4_net_dev()callsrcu_read_unlock()iffib_lookup()fails. Detected by sparse. Compile-tested only.Fixes "IB/cma: Validate routing of incoming requests" (commit f887f2ac87c2).Cc Haggai Eran <haggaie-VPRAkNaXOzVWk0Htik3J/[email protected]>Cc stable <[email protected]>
Looks good,
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Haggai Eran
Reviewed-byQuoted 6 lines · Bart Van Assche
Ensure that
validate_ipv4_net_dev()callsrcu_read_unlock()iffib_lookup()fails. Detected by sparse. Compile-tested only.Fixes "IB/cma: Validate routing of incoming requests" (commit f887f2ac87c2).Cc Haggai Eran <haggaie-VPRAkNaXOzVWk0Htik3J/[email protected]>Cc stable <[email protected]>
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Jason Gunthorpe
Reviewed-byQuoted 8 lines · Bart Van Assche
Ensure that
validate_ipv4_net_dev()callsrcu_read_unlock()iffib_lookup()fails. Detected by sparse. Compile-tested only.Fixes "IB/cma: Validate routing of incoming requests" (commit f887f2ac87c2).Cc Haggai Eran <haggaie-VPRAkNaXOzVWk0Htik3J/[email protected]>Cc stable <[email protected]>drivers/infiniband/core/cma.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
Yep
You say sparse detected this? Mellanox/Or folks - I thought you ran all the common static stuff on your patches?
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html