From patchwork Tue Dec 17 09:58:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yann Droneaud X-Patchwork-Id: 3360361 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 513DDC0D4A for ; Tue, 17 Dec 2013 09:59:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3357E203A7 for ; Tue, 17 Dec 2013 09:59:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7E4A6203A3 for ; Tue, 17 Dec 2013 09:59:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753209Ab3LQJ7s (ORCPT ); Tue, 17 Dec 2013 04:59:48 -0500 Received: from smtp5-g21.free.fr ([212.27.42.5]:51306 "EHLO smtp5-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751430Ab3LQJ7r (ORCPT ); Tue, 17 Dec 2013 04:59:47 -0500 Received: from localhost.localdomain (unknown [37.163.161.54]) by smtp5-g21.free.fr (Postfix) with ESMTP id 70E77D48065; Tue, 17 Dec 2013 10:59:40 +0100 (CET) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.14.7/8.14.7) with ESMTP id rBH9xbJY002066; Tue, 17 Dec 2013 10:59:37 +0100 Received: (from ydroneaud@localhost) by localhost.localdomain (8.14.7/8.14.7/Submit) id rBH9xaYs002065; Tue, 17 Dec 2013 10:59:36 +0100 From: Yann Droneaud To: Roland Dreier , Roland Dreier Cc: linux-rdma@vger.kernel.org, Yann Droneaud Subject: [PATCHv4 for-3.13 04/10] IB/uverbs: set outbuf to NULL when no core response space is provided Date: Tue, 17 Dec 2013 10:58:53 +0100 Message-Id: <330b13a0884b6cc03e287a32f8f49c1aac6bdbed.1387273677.git.ydroneaud@opteya.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: References: In-Reply-To: References: Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In the currently uncommon case of core (eg. uverbs) response space being omitted, but hw (eg. provider) response space being available, outbuf get defined to "response" while it must be NULL. This patch takes care of setting ucore->outbuf to NULL if hdr.out_words is equal to 0. Link: http://marc.info/?i=cover.1387273677.git.ydroneaud@opteya.com Signed-off-by: Yann Droneaud --- drivers/infiniband/core/uverbs_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c index 14d864371050..6c4fc6338b26 100644 --- a/drivers/infiniband/core/uverbs_main.c +++ b/drivers/infiniband/core/uverbs_main.c @@ -681,7 +681,7 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf, INIT_UDATA(&ucore, (hdr.in_words) ? buf : NULL, - response, + (hdr.out_words) ? response : NULL, hdr.in_words * 8, hdr.out_words * 8);