mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
net: rds: Fix possible NULL-pointer dereference
[ Upstream commitf1d95df0f3
] In rds_rdma_cm_event_handler_cmn() check, if conn pointer exists before dereferencing it as rdma_set_service_type() argument Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes:fd261ce6a3
("rds: rdma: update rdma transport for tos") Signed-off-by: Artem Chernyshev <artem.chernyshev@red-soft.ru> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
2eebf58ce0
commit
069ac51c37
@ -86,11 +86,13 @@ static int rds_rdma_cm_event_handler_cmn(struct rdma_cm_id *cm_id,
|
||||
break;
|
||||
|
||||
case RDMA_CM_EVENT_ADDR_RESOLVED:
|
||||
rdma_set_service_type(cm_id, conn->c_tos);
|
||||
rdma_set_min_rnr_timer(cm_id, IB_RNR_TIMER_000_32);
|
||||
/* XXX do we need to clean up if this fails? */
|
||||
ret = rdma_resolve_route(cm_id,
|
||||
RDS_RDMA_RESOLVE_TIMEOUT_MS);
|
||||
if (conn) {
|
||||
rdma_set_service_type(cm_id, conn->c_tos);
|
||||
rdma_set_min_rnr_timer(cm_id, IB_RNR_TIMER_000_32);
|
||||
/* XXX do we need to clean up if this fails? */
|
||||
ret = rdma_resolve_route(cm_id,
|
||||
RDS_RDMA_RESOLVE_TIMEOUT_MS);
|
||||
}
|
||||
break;
|
||||
|
||||
case RDMA_CM_EVENT_ROUTE_RESOLVED:
|
||||
|
Loading…
Reference in New Issue
Block a user