From patchwork Tue Nov 19 14:48:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yann Droneaud X-Patchwork-Id: 3202881 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7A0AF9F26C for ; Tue, 19 Nov 2013 14:49:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CDABA20306 for ; Tue, 19 Nov 2013 14:49:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3D288202E5 for ; Tue, 19 Nov 2013 14:49:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752683Ab3KSOtr (ORCPT ); Tue, 19 Nov 2013 09:49:47 -0500 Received: from smtp2-g21.free.fr ([212.27.42.2]:33791 "EHLO smtp2-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752427Ab3KSOtq (ORCPT ); Tue, 19 Nov 2013 09:49:46 -0500 Received: from localhost.localdomain (unknown [37.162.20.20]) by smtp2-g21.free.fr (Postfix) with ESMTP id BE9114B01AC; Tue, 19 Nov 2013 15:49:38 +0100 (CET) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.14.7/8.14.7) with ESMTP id rAJEnZKG032065; Tue, 19 Nov 2013 15:49:36 +0100 Received: (from ydroneaud@localhost) by localhost.localdomain (8.14.7/8.14.7/Submit) id rAJEnQ0F032047; Tue, 19 Nov 2013 15:49:26 +0100 From: Yann Droneaud To: Roland Dreier , Roland Dreier Cc: Yann Droneaud , linux-rdma@vger.kernel.org, Matan Barak Subject: [PATCH for-next] IB/uverbs: set ucore.outbuf to NULL if core response space is omitted Date: Tue, 19 Nov 2013 15:48:47 +0100 Message-Id: <1384872527-26154-1-git-send-email-ydroneaud@opteya.com> X-Mailer: git-send-email 1.8.4.2 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. Cc: Matan Barak Signed-off-by: Yann Droneaud --- Hi Roland, This one apply on top of my previous patch to fix sparse warning[1][2]: rewritting the line make it obvious I missed this rather unseen before case, but the new improved extensible command scheme allows it, so it must done right. [1] http://marc.info/?i=cover.1384869925.git.ydroneaud@opteya.com [2] https://patchwork.kernel.org/patch/3202411/ Regards. 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 14d8643..6c4fc63 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);