IB/ehca: Returns an error on ib_copy_to_udata() failure
[firefly-linux-kernel-4.4.55.git] / drivers / infiniband / hw / ehca / ehca_cq.c
index 212150c25ea08ade17d2713b882db69bb502ca03..8cc837537768f97f99041ec7ab69d2e111dba0c0 100644 (file)
@@ -283,6 +283,7 @@ struct ib_cq *ehca_create_cq(struct ib_device *device, int cqe, int comp_vector,
                        (my_cq->galpas.user.fw_handle & (PAGE_SIZE - 1));
                if (ib_copy_to_udata(udata, &resp, sizeof(resp))) {
                        ehca_err(device, "Copy to udata failed.");
+                       cq = ERR_PTR(-EFAULT);
                        goto create_cq_exit4;
                }
        }