lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <EA4233BB-E615-411E-BC99-14D8A2A367EE@mellanox.com>
Date:   Sun, 19 Feb 2017 19:54:07 +0000
From:   Majd Dibbiny <majd@...lanox.com>
To:     SF Markus Elfring <elfring@...rs.sourceforge.net>
CC:     "linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
        Doug Ledford <dledford@...hat.com>,
        Hal Rosenstock <hal.rosenstock@...il.com>,
        "Leon Romanovsky" <leonro@...lanox.com>,
        Matan Barak <matanb@...lanox.com>,
        "Sean Hefty" <sean.hefty@...el.com>,
        Yishai Hadas <yishaih@...lanox.com>,
        LKML <linux-kernel@...r.kernel.org>,
        "kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>
Subject: Re: [PATCH 23/29] IB/mlx4: Improve size determinations in
 create_qp_common()


> On Feb 18, 2017, at 11:15 PM, SF Markus Elfring <elfring@...rs.sourceforge.net> wrote:
> 
> From: Markus Elfring <elfring@...rs.sourceforge.net>
> Date: Sat, 18 Feb 2017 18:29:30 +0100
> 
> Replace the specification of two data structures by pointer dereferences
> as the parameter for the operator "sizeof" to make the corresponding size
> determinations a bit safer according to the Linux coding style convention.
> 
> Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
> ---
> drivers/infiniband/hw/mlx4/qp.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
> index 11fec4a8fae5..cc7bd257a1fd 100644
> --- a/drivers/infiniband/hw/mlx4/qp.c
> +++ b/drivers/infiniband/hw/mlx4/qp.c
> @@ -691,14 +691,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);
> +            sqp = kzalloc(sizeof(*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);
> +            qp = kzalloc(sizeof(*qp), gfp);
>            if (!qp)
>                return -ENOMEM;
>            qp->pri.vid = 0xFFFF;
> -- 
> 2.11.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Thanks,
Reviewed-by: Majd Dibbiny
<majd@...lanox.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ