CC: [email protected] BCC: [email protected] CC: [email protected] TO: Mark Zhang <[email protected]> CC: Leon Romanovsky <[email protected]>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git testing/rdma-rc head: c13a08911e7631d9ec7aea7ee7158a67466f9cd5 commit: e1390ac2297d8a0dafa312d2720059d6270e9356 [3/5] RDMA/cma: Limit join multicast to UD QP type only :::::: branch date: 2 days ago :::::: commit date: 4 days ago config: arm64-randconfig-m031-20220415 (https://download.01.org/0day-ci/archive/20220417/[email protected]/config) compiler: aarch64-linux-gcc (GCC) 11.2.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> smatch warnings: drivers/infiniband/core/cma.c:4434 rdma_accept() error: we previously assumed 'conn_param' could be null (see line 4426) vim +/conn_param +4434 drivers/infiniband/core/cma.c 628e5f6d39d5a6b Sean Hefty 2006-11-30 4396 b09c4d70122091c Leon Romanovsky 2020-09-22 4397 /** b09c4d70122091c Leon Romanovsky 2020-09-22 4398 * rdma_accept - Called to accept a connection request or response. b09c4d70122091c Leon Romanovsky 2020-09-22 4399 * @id: Connection identifier associated with the request. b09c4d70122091c Leon Romanovsky 2020-09-22 4400 * @conn_param: Information needed to establish the connection. This must be b09c4d70122091c Leon Romanovsky 2020-09-22 4401 * provided if accepting a connection request. If accepting a connection b09c4d70122091c Leon Romanovsky 2020-09-22 4402 * response, this parameter must be NULL. b09c4d70122091c Leon Romanovsky 2020-09-22 4403 * b09c4d70122091c Leon Romanovsky 2020-09-22 4404 * Typically, this routine is only called by the listener to accept a connection b09c4d70122091c Leon Romanovsky 2020-09-22 4405 * request. It must also be called on the active side of a connection if the b09c4d70122091c Leon Romanovsky 2020-09-22 4406 * user is performing their own QP transitions. b09c4d70122091c Leon Romanovsky 2020-09-22 4407 * b09c4d70122091c Leon Romanovsky 2020-09-22 4408 * In the case of error, a reject message is sent to the remote side and the b09c4d70122091c Leon Romanovsky 2020-09-22 4409 * state of the qp associated with the id is modified to error, such that any b09c4d70122091c Leon Romanovsky 2020-09-22 4410 * previously posted receive buffers would be flushed. b09c4d70122091c Leon Romanovsky 2020-09-22 4411 * b09c4d70122091c Leon Romanovsky 2020-09-22 4412 * This function is for use by kernel ULPs and must be called from under the b09c4d70122091c Leon Romanovsky 2020-09-22 4413 * handler callback. b09c4d70122091c Leon Romanovsky 2020-09-22 4414 */ b09c4d70122091c Leon Romanovsky 2020-09-22 4415 int rdma_accept(struct rdma_cm_id *id, struct rdma_conn_param *conn_param) e51060f08a61965 Sean Hefty 2006-06-17 4416 { d114c6feedfe060 Jason Gunthorpe 2020-08-18 4417 struct rdma_id_private *id_priv = d114c6feedfe060 Jason Gunthorpe 2020-08-18 4418 container_of(id, struct rdma_id_private, id); e51060f08a61965 Sean Hefty 2006-06-17 4419 int ret; e51060f08a61965 Sean Hefty 2006-06-17 4420 d114c6feedfe060 Jason Gunthorpe 2020-08-18 4421 lockdep_assert_held(&id_priv->handler_mutex); 83e9502d8db1428 Nir Muchtar 2011-01-13 4422 d114c6feedfe060 Jason Gunthorpe 2020-08-18 4423 if (READ_ONCE(id_priv->state) != RDMA_CM_CONNECT) e51060f08a61965 Sean Hefty 2006-06-17 4424 return -EINVAL; e51060f08a61965 Sean Hefty 2006-06-17 4425 e51060f08a61965 Sean Hefty 2006-06-17 @4426 if (!id->qp && conn_param) { e51060f08a61965 Sean Hefty 2006-06-17 4427 id_priv->qp_num = conn_param->qp_num; e51060f08a61965 Sean Hefty 2006-06-17 4428 id_priv->srq = conn_param->srq; e51060f08a61965 Sean Hefty 2006-06-17 4429 } e51060f08a61965 Sean Hefty 2006-06-17 4430 72219cea8e246a5 Michael Wang 2015-05-05 4431 if (rdma_cap_ib_cm(id->device, id->port_num)) { f45ee80eb0dda1f Hefty, Sean 2011-10-06 4432 if (id->qp_type == IB_QPT_UD) { 628e5f6d39d5a6b Sean Hefty 2006-11-30 4433 ret = cma_send_sidr_rep(id_priv, IB_SIDR_SUCCESS, 5c438135adf90b3 Sean Hefty 2013-05-29 @4434 conn_param->qkey, 628e5f6d39d5a6b Sean Hefty 2006-11-30 4435 conn_param->private_data, 628e5f6d39d5a6b Sean Hefty 2006-11-30 4436 conn_param->private_data_len); f45ee80eb0dda1f Hefty, Sean 2011-10-06 4437 } else { f45ee80eb0dda1f Hefty, Sean 2011-10-06 4438 if (conn_param) e51060f08a61965 Sean Hefty 2006-06-17 4439 ret = cma_accept_ib(id_priv, conn_param); e51060f08a61965 Sean Hefty 2006-06-17 4440 else e51060f08a61965 Sean Hefty 2006-06-17 4441 ret = cma_rep_recv(id_priv); f45ee80eb0dda1f Hefty, Sean 2011-10-06 4442 } b6eb7011f561a29 Wenpeng Liang 2021-04-07 4443 } else if (rdma_cap_iw_cm(id->device, id->port_num)) { 07ebafbaaa72aa6 Tom Tucker 2006-08-03 4444 ret = cma_accept_iw(id_priv, conn_param); b6eb7011f561a29 Wenpeng Liang 2021-04-07 4445 } else { e51060f08a61965 Sean Hefty 2006-06-17 4446 ret = -ENOSYS; b6eb7011f561a29 Wenpeng Liang 2021-04-07 4447 } e51060f08a61965 Sean Hefty 2006-06-17 4448 if (ret) e51060f08a61965 Sean Hefty 2006-06-17 4449 goto reject; e51060f08a61965 Sean Hefty 2006-06-17 4450 e51060f08a61965 Sean Hefty 2006-06-17 4451 return 0; e51060f08a61965 Sean Hefty 2006-06-17 4452 reject: c5483388bb4d771 Sean Hefty 2007-09-24 4453 cma_modify_qp_err(id_priv); 8094ba0ace7f6cd Leon Romanovsky 2020-05-26 4454 rdma_reject(id, NULL, 0, IB_CM_REJ_CONSUMER_DEFINED); e51060f08a61965 Sean Hefty 2006-06-17 4455 return ret; e51060f08a61965 Sean Hefty 2006-06-17 4456 } b09c4d70122091c Leon Romanovsky 2020-09-22 4457 EXPORT_SYMBOL(rdma_accept); e51060f08a61965 Sean Hefty 2006-06-17 4458 :::::: The code at line 4434 was first introduced by commit :::::: 5c438135adf90b33cb00e5351becf1e557bbdd9d RDMA/cma: Set qkey for AF_IB :::::: TO: Sean Hefty <[email protected]> :::::: CC: Roland Dreier <[email protected]> -- 0-DAY CI Kernel Test Service https://01.org/lkp _______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
