From: Kamal Heib <kamalheib1@gmail.com>
To: Haakon Bugge <haakon.bugge@oracle.com>
Cc: OFED mailing list <linux-rdma@vger.kernel.org>,
Wenpeng Liang <liangwenpeng@huawei.com>,
Weihang Li <liweihang@huawei.com>,
Doug Ledford <dledford@redhat.com>,
Jason Gunthorpe <jgg@ziepe.ca>
Subject: Re: [PATCH for-rc] RDMA/hns: Validate the pkey index
Date: Wed, 17 Nov 2021 16:50:26 +0200 [thread overview]
Message-ID: <YZUWst63NnrfbxaK@fedora> (raw)
In-Reply-To: <26672F24-3F75-4F41-AD6C-08AE482DE55F@oracle.com>
On Wed, Nov 17, 2021 at 11:45:49AM +0000, Haakon Bugge wrote:
>
>
> > On 17 Nov 2021, at 12:10, Kamal Heib <kamalheib1@gmail.com> wrote:
> >
> > Before query pkey, make sure that the quered index is valid.
>
> queried index ?
>
> Thxs, Håkon
>
My bad, I'll fix it in v2.
Thanks,
Kamal
> >
> > Fixes: 9a4435375cd1 ("IB/hns: Add driver files for hns RoCE driver")
> > Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
> > ---
> > drivers/infiniband/hw/hns/hns_roce_main.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c
> > index 4194b626f3c6..8233bec053ee 100644
> > --- a/drivers/infiniband/hw/hns/hns_roce_main.c
> > +++ b/drivers/infiniband/hw/hns/hns_roce_main.c
> > @@ -270,6 +270,9 @@ static enum rdma_link_layer hns_roce_get_link_layer(struct ib_device *device,
> > static int hns_roce_query_pkey(struct ib_device *ib_dev, u32 port, u16 index,
> > u16 *pkey)
> > {
> > + if (index > 0)
> > + return -EINVAL;
> > +
> > *pkey = PKEY_ID;
> >
> > return 0;
> > --
> > 2.31.1
> >
>
prev parent reply other threads:[~2021-11-17 14:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-17 11:10 [PATCH for-rc] RDMA/hns: Validate the pkey index Kamal Heib
2021-11-17 11:45 ` Haakon Bugge
2021-11-17 14:50 ` Kamal Heib [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YZUWst63NnrfbxaK@fedora \
--to=kamalheib1@gmail.com \
--cc=dledford@redhat.com \
--cc=haakon.bugge@oracle.com \
--cc=jgg@ziepe.ca \
--cc=liangwenpeng@huawei.com \
--cc=linux-rdma@vger.kernel.org \
--cc=liweihang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.