diff options
author | Sasha Levin <sasha.levin@oracle.com> | 2014-03-29 20:39:35 -0400 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2014-04-30 16:23:18 +0100 |
commit | 710da494970f1d73c7df3fc0997e565cf4396e9d (patch) | |
tree | 3aa4b933d567ea7cff253303bb7f6e85a9a6431e /net | |
parent | a0035ead18a914e0407b946876ac5be0ab09af61 (diff) | |
download | lwn-710da494970f1d73c7df3fc0997e565cf4396e9d.tar.gz lwn-710da494970f1d73c7df3fc0997e565cf4396e9d.zip |
rds: prevent dereference of a NULL device in rds_iw_laddr_check
[ Upstream commit bf39b4247b8799935ea91d90db250ab608a58e50 ]
Binding might result in a NULL device which is later dereferenced
without checking.
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'net')
-rw-r--r-- | net/rds/iw.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/rds/iw.c b/net/rds/iw.c index 7826d46baa70..589935661d66 100644 --- a/net/rds/iw.c +++ b/net/rds/iw.c @@ -239,7 +239,8 @@ static int rds_iw_laddr_check(__be32 addr) ret = rdma_bind_addr(cm_id, (struct sockaddr *)&sin); /* due to this, we will claim to support IB devices unless we check node_type. */ - if (ret || cm_id->device->node_type != RDMA_NODE_RNIC) + if (ret || !cm_id->device || + cm_id->device->node_type != RDMA_NODE_RNIC) ret = -EADDRNOTAVAIL; rdsdebug("addr %pI4 ret %d node type %d\n", |