Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6fcd8d0d authored by Jiri Kosina's avatar Jiri Kosina Committed by Roland Dreier
Browse files

IB/mlx4: Fix gfp passing in create_qp_common()



There are two kzalloc() calls which were not converted to use value of
gfp passed to create_qp_common() instead of using hardcoded GFP_KERNEL
in 40f2287b ("IB/mlx4: Implement IB_QP_CREATE_USE_GFP_NOIO").  Fix
this by passing gfp value down properly.

Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 4e2c341b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -659,14 +659,14 @@ static int create_qp_common(struct mlx4_ib_dev *dev, struct ib_pd *pd,
		if (qp_type == MLX4_IB_QPT_SMI || qp_type == MLX4_IB_QPT_GSI ||
		    (qp_type & (MLX4_IB_QPT_PROXY_SMI | MLX4_IB_QPT_PROXY_SMI_OWNER |
				MLX4_IB_QPT_PROXY_GSI | MLX4_IB_QPT_TUN_SMI_OWNER))) {
			sqp = kzalloc(sizeof (struct mlx4_ib_sqp), GFP_KERNEL);
			sqp = kzalloc(sizeof (struct mlx4_ib_sqp), gfp);
			if (!sqp)
				return -ENOMEM;
			qp = &sqp->qp;
			qp->pri.vid = 0xFFFF;
			qp->alt.vid = 0xFFFF;
		} else {
			qp = kzalloc(sizeof (struct mlx4_ib_qp), GFP_KERNEL);
			qp = kzalloc(sizeof (struct mlx4_ib_qp), gfp);
			if (!qp)
				return -ENOMEM;
			qp->pri.vid = 0xFFFF;