RDMA/cxgb3: iwch_query_port() - handle null inetdev ptr.
PATCH 1/1 RDMA/cxgb3: iwch_query_port() - handle null inetdev ptr.
in_dev_get() can return NULL. If it does, iwch_query_port() will crash. Handle the NULL case by mapping it to rdma state INIT.
Signed-off-by Steve Wise <[email protected]>
---
drivers/infiniband/hw/cxgb3/iwch_provider.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-)
drivers/infiniband/hw/cxgb3/iwch_provider.c +7 -4
@@ -1199,11 +1199,14 @@ static int iwch_query_port(struct ib_device *ibdev, props->state =IB_PORT_DOWN ; else { inetdev =in_dev_get (netdev); -if (inetdev->ifa_list) - props->state =IB_PORT_ACTIVE ; -else +if (inetdev) { +if (inetdev->ifa_list) + props->state =IB_PORT_ACTIVE ; +else + props->state =IB_PORT_INIT ; +in_dev_put (inetdev); + }else props->state =IB_PORT_INIT ; -in_dev_put (inetdev); } props->port_cap_flags =
--
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): 20091006211321.16751.15175.stgit-T4OLL4TyM9aNDNWfRnPdfg@public.gmane.org
thanks, applied
--
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