[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <SN1PR07MB22076D4325D51DDB3C66E1E8F8D50@SN1PR07MB2207.namprd07.prod.outlook.com>
Date: Thu, 20 Oct 2016 07:12:05 +0000
From: "Amrani, Ram" <Ram.Amrani@...ium.com>
To: Colin King <colin.king@...onical.com>,
Doug Ledford <dledford@...hat.com>,
Sean Hefty <sean.hefty@...el.com>,
Hal Rosenstock <hal.rosenstock@...il.com>,
"Borundia, Rajesh" <Rajesh.Borundia@...ium.com>,
"linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] qedr: return -EINVAL if pd is null and avoid null ptr
dereference
> drivers/infiniband/hw/qedr/verbs.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/hw/qedr/verbs.c
> b/drivers/infiniband/hw/qedr/verbs.c
> index a615142..b2a0eb8 100644
> --- a/drivers/infiniband/hw/qedr/verbs.c
> +++ b/drivers/infiniband/hw/qedr/verbs.c
> @@ -511,8 +511,10 @@ int qedr_dealloc_pd(struct ib_pd *ibpd)
> struct qedr_dev *dev = get_qedr_dev(ibpd->device);
> struct qedr_pd *pd = get_qedr_pd(ibpd);
>
> - if (!pd)
> + if (!pd) {
> pr_err("Invalid PD received in dealloc_pd\n");
> + return -EINVAL;
> + }
>
> DP_DEBUG(dev, QEDR_MSG_INIT, "Deallocating PD %d\n", pd->pd_id);
> dev->ops->rdma_dealloc_pd(dev->rdma_ctx, pd->pd_id);
> --
> 2.9.3
Thanks Colin.
Acked-by: Ram Amrani <ram.amrani@...ium.com>
Powered by blists - more mailing lists