> -----Original Message----- > From: linux-rdma-owner@xxxxxxxxxxxxxxx [mailto:linux-rdma- > owner@xxxxxxxxxxxxxxx] On Behalf Of Leon Romanovsky > Sent: Monday, March 12, 2018 10:16 AM > To: Doug Ledford <dledford@xxxxxxxxxx>; Jason Gunthorpe > <jgg@xxxxxxxxxxxx> > Cc: Leon Romanovsky <leonro@xxxxxxxxxxxx>; RDMA mailing list <linux- > rdma@xxxxxxxxxxxxxxx>; Steve Wise <swise@xxxxxxxxxxxxxxxxxxxxx> > Subject: [PATCH rdma-next 13/15] RDMA/qib: Zero all allocated memory > > From: Leon Romanovsky <leonro@xxxxxxxxxxxx> > > Replace general allocations to be zero based. > > Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx> > --- > drivers/infiniband/hw/qib/qib_verbs.c | 2 +- > > diff --git a/drivers/infiniband/hw/qib/qib_verbs.c > b/drivers/infiniband/hw/qib/qib_verbs.c > index 3977abbc83ad..cdff461d4053 100644 > --- a/drivers/infiniband/hw/qib/qib_verbs.c > +++ b/drivers/infiniband/hw/qib/qib_verbs.c > @@ -870,7 +870,7 @@ static int qib_verbs_send_dma(struct rvt_qp *qp, > struct ib_header *hdr, > > /* Allocate a buffer and copy the header and payload to it. */ > tx->hdr_dwords = plen + 1; > - phdr = kmalloc(tx->hdr_dwords << 2, GFP_ATOMIC); > + phdr = kzalloc(tx->hdr_dwords << 2, GFP_ATOMIC); > if (!phdr) > goto err_tx; > phdr->pbc[0] = cpu_to_le32(plen); This is performance path. Please do not use the zero based allocation. Thanks, Mike > -- > 2.14.3 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html