Hi Zhu, Thank you for the patch! Yet something to improve: [auto build test ERROR on sof-driver-fuweitax/master] [also build test ERROR on v4.19-rc5 next-20180928] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Zhu-Yanjun/IB-rxe-avoid-srq-memory-leak/20180930-115114 base: https://github.com/fuweitax/linux master config: sparc-allmodconfig (attached as .config) compiler: sparc64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree GCC_VERSION=7.2.0 make.cross ARCH=sparc All errors (new ones prefixed by >>): drivers/infiniband/sw/rxe/rxe_srq.c: In function 'rxe_srq_from_init': >> drivers/infiniband/sw/rxe/rxe_srq.c:133:3: error: implicit declaration of function 'vfree'; did you mean 'kvfree'? [-Werror=implicit-function-declaration] vfree(q->buf); ^~~~~ kvfree cc1: some warnings being treated as errors vim +133 drivers/infiniband/sw/rxe/rxe_srq.c 99 100 int rxe_srq_from_init(struct rxe_dev *rxe, struct rxe_srq *srq, 101 struct ib_srq_init_attr *init, 102 struct ib_ucontext *context, 103 struct rxe_create_srq_resp __user *uresp) 104 { 105 int err; 106 int srq_wqe_size; 107 struct rxe_queue *q; 108 109 srq->ibsrq.event_handler = init->event_handler; 110 srq->ibsrq.srq_context = init->srq_context; 111 srq->limit = init->attr.srq_limit; 112 srq->srq_num = srq->pelem.index; 113 srq->rq.max_wr = init->attr.max_wr; 114 srq->rq.max_sge = init->attr.max_sge; 115 116 srq_wqe_size = rcv_wqe_size(srq->rq.max_sge); 117 118 spin_lock_init(&srq->rq.producer_lock); 119 spin_lock_init(&srq->rq.consumer_lock); 120 121 q = rxe_queue_init(rxe, &srq->rq.max_wr, 122 srq_wqe_size); 123 if (!q) { 124 pr_warn("unable to allocate queue for srq\n"); 125 return -ENOMEM; 126 } 127 128 srq->rq.queue = q; 129 130 err = do_mmap_info(rxe, uresp ? &uresp->mi : NULL, context, q->buf, 131 q->buf_size, &q->ip); 132 if (err) { > 133 vfree(q->buf); 134 kfree(q); 135 return err; 136 } 137 138 if (uresp) { 139 if (copy_to_user(&uresp->srq_num, &srq->srq_num, 140 sizeof(uresp->srq_num))) { 141 rxe_queue_cleanup(q); 142 return -EFAULT; 143 } 144 } 145 146 return 0; 147 } 148 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip