IB/rxe: replace kvfree with vfree
The buf is allocated by vmalloc_user in the function rxe_queue_init.
So it is better to free it by vfree.
Fixes: 8700e3e7c4
("Soft RoCE driver")
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
parent
65f07f5a09
commit
721ad7e643
|
@ -30,7 +30,7 @@
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
#include <linux/vmalloc.h>
|
||||||
#include "rxe.h"
|
#include "rxe.h"
|
||||||
#include "rxe_loc.h"
|
#include "rxe_loc.h"
|
||||||
#include "rxe_queue.h"
|
#include "rxe_queue.h"
|
||||||
|
@ -97,7 +97,7 @@ int rxe_cq_from_init(struct rxe_dev *rxe, struct rxe_cq *cq, int cqe,
|
||||||
err = do_mmap_info(rxe, uresp ? &uresp->mi : NULL, context,
|
err = do_mmap_info(rxe, uresp ? &uresp->mi : NULL, context,
|
||||||
cq->queue->buf, cq->queue->buf_size, &cq->queue->ip);
|
cq->queue->buf, cq->queue->buf_size, &cq->queue->ip);
|
||||||
if (err) {
|
if (err) {
|
||||||
kvfree(cq->queue->buf);
|
vfree(cq->queue->buf);
|
||||||
kfree(cq->queue);
|
kfree(cq->queue);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
#include <linux/skbuff.h>
|
#include <linux/skbuff.h>
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
|
#include <linux/vmalloc.h>
|
||||||
|
|
||||||
#include "rxe.h"
|
#include "rxe.h"
|
||||||
#include "rxe_loc.h"
|
#include "rxe_loc.h"
|
||||||
|
@ -257,7 +258,7 @@ static int rxe_qp_init_req(struct rxe_dev *rxe, struct rxe_qp *qp,
|
||||||
&qp->sq.queue->ip);
|
&qp->sq.queue->ip);
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
kvfree(qp->sq.queue->buf);
|
vfree(qp->sq.queue->buf);
|
||||||
kfree(qp->sq.queue);
|
kfree(qp->sq.queue);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
@ -310,7 +311,7 @@ static int rxe_qp_init_resp(struct rxe_dev *rxe, struct rxe_qp *qp,
|
||||||
qp->rq.queue->buf, qp->rq.queue->buf_size,
|
qp->rq.queue->buf, qp->rq.queue->buf_size,
|
||||||
&qp->rq.queue->ip);
|
&qp->rq.queue->ip);
|
||||||
if (err) {
|
if (err) {
|
||||||
kvfree(qp->rq.queue->buf);
|
vfree(qp->rq.queue->buf);
|
||||||
kfree(qp->rq.queue);
|
kfree(qp->rq.queue);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue