From patchwork Thu Mar 14 15:30:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 10853117 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 8F487139A for ; Thu, 14 Mar 2019 15:42:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 789A82A5A2 for ; Thu, 14 Mar 2019 15:42:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76B8B2A5CB; Thu, 14 Mar 2019 15:42:46 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0D4102A5DB for ; Thu, 14 Mar 2019 15:42:45 +0000 (UTC) Received: from localhost ([127.0.0.1]:39828 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h4SVJ-0006kU-72 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 14 Mar 2019 11:42:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h4SJq-0006Ar-Er for qemu-devel@nongnu.org; Thu, 14 Mar 2019 11:30:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h4SJm-0006S9-EA for qemu-devel@nongnu.org; Thu, 14 Mar 2019 11:30:54 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:44721) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h4SJl-0006QC-VT for qemu-devel@nongnu.org; Thu, 14 Mar 2019 11:30:50 -0400 Received: by mail-wr1-x441.google.com with SMTP id w2so6310828wrt.11 for ; Thu, 14 Mar 2019 08:30:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZrIRSjceMaARp68/6KKBGCWqfHpjnd9tX6EHHrCOEns=; b=DvoXG6Kr7cwxcs049VLW2m3Z2W/x5yHyW1PjR3BXIGzQfX0FKogYE1iuyYBeP4Owgq +iTBjtoJZ+f7u03SlUBQ/d8O2dgZqot593drXttHhmOeBKp0mx2h/cZs1CT+OVN6F3DO NK7CylpryHvwBkkg5Kr0zj2/7eqiNebp7xfdOSBwnJRhGxSFyN1UvCkYkOrg04y0gsox Kmm+yuCR5sKNKt+jR1BfnGEixOLonxE3lcMDcCcg7L/40JrJCyOPfOonyvkgp/fWeqoT 59mgjOUm0lymqEMvQG5/oCRgbpUqPRHfot8A1IsFwK0k59v/wSFpzv1Ha+hlTWfqHZ9x E44g== 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=ZrIRSjceMaARp68/6KKBGCWqfHpjnd9tX6EHHrCOEns=; b=hiBbj79FsYiccP2i5+LiwrcF8b4g4Hu6f8hawwVbtP9WWC7HUWWRJDqtnAj/wOQQnO 2TvpInU7PflIUA23lLUEhPWu8hN92vvYmDsEukTkz2yfElWzgOYSTznu7lR1S4fwj/5w MZNcH8ggHHrWRirfTryXOSEBHN+lX9x3r96GIllgsdYc8x39vKmDGAqUF9l8LWfDJPlw 2DljCgxTrl3v9wqTspv3hzYn2rXJmQlRtR2BCWACQnNKhs4Cd39BedA37+VLzbz5chKN N7hORyTxH9+yjzowUfQaj2wSfu10eYKhqzl9JmloZukIA5wpCzxR70drLxTqpI98Z5/n rnyg== X-Gm-Message-State: APjAAAXyaN+ld878/Y5xoVlyXG4pI2a/lQA9ldiyxba96qSZuZNGdCAY 4nnefuKKgUFSiJbRdYhd1qx+/KOE X-Google-Smtp-Source: APXvYqyX5Kn+IfZjX5U8UBo7D/LIMBIYIAlSZO1V+W037Nkt4A8N0Oe6G50NajFnas6DXf5btl37xg== X-Received: by 2002:a5d:5482:: with SMTP id h2mr12872595wrv.203.1552577447425; Thu, 14 Mar 2019 08:30:47 -0700 (PDT) Received: from kheib-workstation.redhat.com ([192.116.94.220]) by smtp.gmail.com with ESMTPSA id d9sm32070909wrn.72.2019.03.14.08.30.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Mar 2019 08:30:46 -0700 (PDT) From: Kamal Heib To: qemu-devel@nongnu.org Date: Thu, 14 Mar 2019 17:30:31 +0200 Message-Id: <20190314153031.7197-5-kamalheib1@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190314153031.7197-1-kamalheib1@gmail.com> References: <20190314153031.7197-1-kamalheib1@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 Subject: [Qemu-devel] [PATCH v2 4/4] hw/pvrdma: Fix zero-initialization of resp in {query/modify}_qp X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kamal Heib , Yuval Shaia Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Make sure to zero-initialize only the pvrdma_cmd_query_qp_resp and not the whole pvrdma_cmd_resp for query_qp, in modify_qp the resp isn't used so remove it. Reviewed-by: Yuval Shaia Signed-off-by: Kamal Heib --- hw/rdma/vmw/pvrdma_cmd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/rdma/vmw/pvrdma_cmd.c b/hw/rdma/vmw/pvrdma_cmd.c index a0f2b13a2438..d1ca20a3f90d 100644 --- a/hw/rdma/vmw/pvrdma_cmd.c +++ b/hw/rdma/vmw/pvrdma_cmd.c @@ -488,8 +488,6 @@ static int modify_qp(PVRDMADev *dev, union pvrdma_cmd_req *req, struct pvrdma_cmd_modify_qp *cmd = &req->modify_qp; int rc; - memset(rsp, 0, sizeof(*rsp)); - /* No need to verify sgid_index since it is u8 */ rc = rdma_rm_modify_qp(&dev->rdma_dev_res, &dev->backend_dev, @@ -512,7 +510,7 @@ static int query_qp(PVRDMADev *dev, union pvrdma_cmd_req *req, struct ibv_qp_init_attr init_attr; int rc; - memset(rsp, 0, sizeof(*rsp)); + memset(resp, 0, sizeof(*resp)); rc = rdma_rm_query_qp(&dev->rdma_dev_res, &dev->backend_dev, cmd->qp_handle, (struct ibv_qp_attr *)&resp->attrs, cmd->attr_mask,