diff options
author | Gal Pressman <galpress@amazon.com> | 2019-04-30 11:46:39 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2019-05-02 17:07:02 -0300 |
commit | f89adedaf3feb2e1a896b2f2387cdcb4e2b9c48b (patch) | |
tree | 72ec3e104f5d6fc21eca9bff9771e00a1a8c1a7a | |
parent | 7872168a839144dbbfb33125262dab0673f9ddf5 (diff) | |
download | linux-stable-f89adedaf3feb2e1a896b2f2387cdcb4e2b9c48b.tar.gz linux-stable-f89adedaf3feb2e1a896b2f2387cdcb4e2b9c48b.tar.bz2 linux-stable-f89adedaf3feb2e1a896b2f2387cdcb4e2b9c48b.zip |
RDMA/uverbs: Initialize udata struct on destroy flows
Cited commit introduced the udata parameter to different destroy flows
but the uapi method definition does not have udata (i.e has_udata flag
is not set). As a result, an uninitialized udata struct is being passed
down to the driver callbacks.
Fix that by clearing the driver udata even in cases where has_udata flag
is not set.
Fixes: c4367a26357b ("IB: Pass uverbs_attr_bundle down ib_x destroy path")
Cc: Shamir Rabinovitch <shamir.rabinovitch@oracle.com>
Co-developed-by: Jason Gunthorpe <jgg@ziepe.ca>
Signed-off-by: Jason Gunthorpe <jgg@ziepe.ca>
Signed-off-by: Gal Pressman <galpress@amazon.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
-rw-r--r-- | drivers/infiniband/core/uverbs_ioctl.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/infiniband/core/uverbs_ioctl.c b/drivers/infiniband/core/uverbs_ioctl.c index cfbef25b3a73..829b0c6944d8 100644 --- a/drivers/infiniband/core/uverbs_ioctl.c +++ b/drivers/infiniband/core/uverbs_ioctl.c @@ -453,6 +453,8 @@ static int ib_uverbs_run_method(struct bundle_priv *pbundle, uverbs_fill_udata(&pbundle->bundle, &pbundle->bundle.driver_udata, UVERBS_ATTR_UHW_IN, UVERBS_ATTR_UHW_OUT); + else + pbundle->bundle.driver_udata = (struct ib_udata){}; if (destroy_bkey != UVERBS_API_ATTR_BKEY_LEN) { struct uverbs_obj_attr *destroy_attr = |