Commit 280302f0 authored by Alison Schofield's avatar Alison Schofield Committed by Dan Williams

cxl/mbox: Replace NULL check with IS_ERR() after vmemdup_user()

vmemdup_user() returns an ERR_PTR() on failure. Use IS_ERR()
to check the return value.
Reported-by: default avatarkernel test robot <lkp@intel.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarAlison Schofield <alison.schofield@intel.com>
Reviewed-by: default avatarIra Weiny <ira.weiny@intel.com>
Link: https://lore.kernel.org/r/20220407010915.1211258-1-alison.schofield@intel.comSigned-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 26f89535
......@@ -265,7 +265,7 @@ static int cxl_mbox_cmd_ctor(struct cxl_mbox_cmd *mbox,
if (in_size) {
mbox->payload_in = vmemdup_user(u64_to_user_ptr(in_payload),
in_size);
if (!mbox->payload_in)
if (IS_ERR(mbox->payload_in))
return PTR_ERR(mbox->payload_in);
if (!cxl_payload_from_user_allowed(opcode, mbox->payload_in)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment