aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/infiniband/hw/cxgb4/provider.c5
-rw-r--r--drivers/infiniband/hw/cxgb4/user.h1
2 files changed, 4 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/cxgb4/provider.c b/drivers/infiniband/hw/cxgb4/provider.c
index a94a3e12c349..c777e22bd8d5 100644
--- a/drivers/infiniband/hw/cxgb4/provider.c
+++ b/drivers/infiniband/hw/cxgb4/provider.c
@@ -122,7 +122,7 @@ static struct ib_ucontext *c4iw_alloc_ucontext(struct ib_device *ibdev,
122 INIT_LIST_HEAD(&context->mmaps); 122 INIT_LIST_HEAD(&context->mmaps);
123 spin_lock_init(&context->mmap_lock); 123 spin_lock_init(&context->mmap_lock);
124 124
125 if (udata->outlen < sizeof(uresp)) { 125 if (udata->outlen < sizeof(uresp) - sizeof(uresp.reserved)) {
126 if (!warned++) 126 if (!warned++)
127 pr_err(MOD "Warning - downlevel libcxgb4 (non-fatal), device status page disabled."); 127 pr_err(MOD "Warning - downlevel libcxgb4 (non-fatal), device status page disabled.");
128 rhp->rdev.flags |= T4_STATUS_PAGE_DISABLED; 128 rhp->rdev.flags |= T4_STATUS_PAGE_DISABLED;
@@ -140,7 +140,8 @@ static struct ib_ucontext *c4iw_alloc_ucontext(struct ib_device *ibdev,
140 context->key += PAGE_SIZE; 140 context->key += PAGE_SIZE;
141 spin_unlock(&context->mmap_lock); 141 spin_unlock(&context->mmap_lock);
142 142
143 ret = ib_copy_to_udata(udata, &uresp, sizeof(uresp)); 143 ret = ib_copy_to_udata(udata, &uresp,
144 sizeof(uresp) - sizeof(uresp.reserved));
144 if (ret) 145 if (ret)
145 goto err_mm; 146 goto err_mm;
146 147
diff --git a/drivers/infiniband/hw/cxgb4/user.h b/drivers/infiniband/hw/cxgb4/user.h
index 9b7534b5f07d..cbd0ce170728 100644
--- a/drivers/infiniband/hw/cxgb4/user.h
+++ b/drivers/infiniband/hw/cxgb4/user.h
@@ -75,5 +75,6 @@ struct c4iw_create_qp_resp {
75struct c4iw_alloc_ucontext_resp { 75struct c4iw_alloc_ucontext_resp {
76 __u64 status_page_key; 76 __u64 status_page_key;
77 __u32 status_page_size; 77 __u32 status_page_size;
78 __u32 reserved; /* explicit padding (optional for i386) */
78}; 79};
79#endif 80#endif