diff options
Diffstat (limited to 'drivers/infiniband/hw/cxgb3/iwch_provider.c')
-rw-r--r-- | drivers/infiniband/hw/cxgb3/iwch_provider.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c index 6895523779d..ed7175549eb 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_provider.c +++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <linux/delay.h> | 37 | #include <linux/delay.h> |
38 | #include <linux/errno.h> | 38 | #include <linux/errno.h> |
39 | #include <linux/list.h> | 39 | #include <linux/list.h> |
40 | #include <linux/sched.h> | ||
40 | #include <linux/spinlock.h> | 41 | #include <linux/spinlock.h> |
41 | #include <linux/ethtool.h> | 42 | #include <linux/ethtool.h> |
42 | #include <linux/rtnetlink.h> | 43 | #include <linux/rtnetlink.h> |
@@ -1199,11 +1200,14 @@ static int iwch_query_port(struct ib_device *ibdev, | |||
1199 | props->state = IB_PORT_DOWN; | 1200 | props->state = IB_PORT_DOWN; |
1200 | else { | 1201 | else { |
1201 | inetdev = in_dev_get(netdev); | 1202 | inetdev = in_dev_get(netdev); |
1202 | if (inetdev->ifa_list) | 1203 | if (inetdev) { |
1203 | props->state = IB_PORT_ACTIVE; | 1204 | if (inetdev->ifa_list) |
1204 | else | 1205 | props->state = IB_PORT_ACTIVE; |
1206 | else | ||
1207 | props->state = IB_PORT_INIT; | ||
1208 | in_dev_put(inetdev); | ||
1209 | } else | ||
1205 | props->state = IB_PORT_INIT; | 1210 | props->state = IB_PORT_INIT; |
1206 | in_dev_put(inetdev); | ||
1207 | } | 1211 | } |
1208 | 1212 | ||
1209 | props->port_cap_flags = | 1213 | props->port_cap_flags = |