Displaying 3 results from an estimated 3 matches for "alloc_inout".
Did you mean:
alloc_inode
2020 Aug 06
1
[PATCH][next] vdpa/mlx5: fix memory allocation failure checks
...++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c
index 3ec44a4f0e45..55bc58e1dae9 100644
--- a/drivers/vdpa/mlx5/net/mlx5_vnet.c
+++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c
@@ -867,7 +867,7 @@ static void alloc_inout(struct mlx5_vdpa_net *ndev, int cmd, void **in, int *inl
*outlen = MLX5_ST_SZ_BYTES(qp_2rst_out);
*in = kzalloc(*inlen, GFP_KERNEL);
*out = kzalloc(*outlen, GFP_KERNEL);
- if (!in || !out)
+ if (!*in || !*out)
goto outerr;
MLX5_SET(qp_2rst_in, *in, opcode, cmd);
@@ -879,7 +879,7...
2020 Aug 07
1
[PATCH] vdpa/mlx5: Fix erroneous null pointer checks
On 2020/8/7 ??3:18, Alex Dewar wrote:
> In alloc_inout() in net/mlx5_vnet.c, there are a few places where memory
> is allocated to *in and *out, but only the values of in and out are
> null-checked (i.e. there is a missing dereference). Fix this.
>
> Addresses-Coverity: ("CID 1496603: (REVERSE_INULL)")
> Fixes: 1a86b377aa21 (&q...
2020 Jul 16
0
[PATCH vhost next 10/10] vdpa/mlx5: Add VDPA driver for supported mlx5 devices
...truct mlx5_vdpa_virtqueue *mvq, bool fw)
> +{
> + return fw ? mvq->vqqp.mqp.qpn : mvq->fwqp.mqp.qpn;
> +}
> +
> +static u32 get_qpn(struct mlx5_vdpa_virtqueue *mvq, bool fw)
> +{
> + return fw ? mvq->fwqp.mqp.qpn : mvq->vqqp.mqp.qpn;
> +}
> +
> +static void alloc_inout(struct mlx5_vdpa_net *ndev, int cmd, void **in, int *inlen, void **out,
> + int *outlen, u32 qpn, u32 rqpn)
> +{
> + void *qpc;
> + void *pp;
> +
> + switch (cmd) {
> + case MLX5_CMD_OP_2RST_QP:
> + *inlen = MLX5_ST_SZ_BYTES(qp_2rst_in);
> + *outlen = MLX5_ST_SZ_BYTES...