mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
rds: prevent dereference of a NULL device in rds_iw_laddr_check
[ Upstream commit bf39b4247b
]
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
8c3911a71e
commit
0447707579
1 changed files with 2 additions and 1 deletions
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue