Message ID | 7eb9ab74-b609-44d3-86f2-60137817aeed@users.sourceforge.net (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 6f667dd..033610b 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -2205,16 +2205,11 @@ static inline bool ib_is_udata_cleared(struct ib_udata *udata, if (len > USHRT_MAX) return false; - buf = kmalloc(len, GFP_KERNEL); - if (!buf) + buf = memdup_user(p, len); + if (IS_ERR(buf)) return false; - if (copy_from_user(buf, p, len)) - goto free; - ret = !memchr_inv(buf, 0, len); - -free: kfree(buf); return ret; }