From patchwork Thu Mar 21 17:24:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10864139 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BE17D139A for ; Thu, 21 Mar 2019 17:24:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9977E2A220 for ; Thu, 21 Mar 2019 17:24:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8DEBC2A256; Thu, 21 Mar 2019 17:24:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 34C2B2A220 for ; Thu, 21 Mar 2019 17:24:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725985AbfCURY1 (ORCPT ); Thu, 21 Mar 2019 13:24:27 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:38436 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728404AbfCURY1 (ORCPT ); Thu, 21 Mar 2019 13:24:27 -0400 Received: by mail-pg1-f194.google.com with SMTP id v1so4648736pgi.5 for ; Thu, 21 Mar 2019 10:24:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6PIuzpMC0k5MJqQvWJTPS/TSLTzNkB3QEWVjNlr4c0E=; b=MOWJpIQAal35kCgHHhJRwe2nW52YpHSiT3rkiTPF42nc7SaZNq6KyENkzpLsztlXJF N/QjLvKB3HT07F4BwiBjI1rhtOTNf2IwpxFgHuUc3UluP8qU1r6LYKIoBsPv3kxPiPjC a7OKpuE/cUo8eAaTMugqxTkYsxuZmuPKhznkXneYJRUuB3YwYtehFk6hVq1ei7qa4wYy 0+gJhmUznN/HlPyfrbtdXy6z+pMUGSrXjWOkOUe+ipDnLhDjL005Z3K89XM4fR2rgYSL Tn72azys+g11HJFDYb4ilmVGBzXlNL8lL/Muko4mWMeAQGFK3hie4FFxoep5J2n1Lb2/ 4E3w== X-Gm-Message-State: APjAAAVXlQvlPzY4tEMZKVdC8lDD0QnurXSg7xoK+4WlzHtx6X/kz7HQ t3LUp/6G/Cqed7aa/oEQY3E= X-Google-Smtp-Source: APXvYqwG3DaZEdDiJe8GiVMufvzN7CXtynhXP1JVM3HdEm0IJJ4K1vqT9ilTYSWYsY/lyGKV2LGTXw== X-Received: by 2002:a63:5318:: with SMTP id h24mr4412814pgb.76.1553189066122; Thu, 21 Mar 2019 10:24:26 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:203:5cdc:422c:7b28:ebb5]) by smtp.gmail.com with ESMTPSA id s184sm7528549pfb.1.2019.03.21.10.24.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Mar 2019 10:24:25 -0700 (PDT) From: Bart Van Assche To: Jason Gunthorpe Cc: Leon Romanovsky , Doug Ledford , linux-rdma@vger.kernel.org, Bart Van Assche Subject: [PATCH 2/8] RDMA/uverbs: Annotate uverbs_request_next_ptr() return value as a __user pointer Date: Thu, 21 Mar 2019 10:24:11 -0700 Message-Id: <20190321172417.77869-3-bvanassche@acm.org> X-Mailer: git-send-email 2.20.GIT In-Reply-To: <20190321172417.77869-1-bvanassche@acm.org> References: <20190321172417.77869-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch avoids that sparse complains about a mismatch between the returned value and the function return type. Cc: Leon Romanovsky Cc: Doug Ledford Fixes: c3bea3d2dc53 ("RDMA/uverbs: Use the iterator for ib_uverbs_unmarshall_recv()") # v5.0. Signed-off-by: Bart Van Assche Reviewed-by: Leon Romanovsky --- drivers/infiniband/core/uverbs_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index 062a86c04123..c9acd94b049d 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -162,7 +162,7 @@ static const void __user *uverbs_request_next_ptr(struct uverbs_req_iter *iter, const void __user *res = iter->cur; if (iter->cur + len > iter->end) - return ERR_PTR(-ENOSPC); + return (void __force __user *)ERR_PTR(-ENOSPC); iter->cur += len; return res; }