From patchwork Wed Mar 13 08:46:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 10850791 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 8D8CF1390 for ; Wed, 13 Mar 2019 08:57:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 778C929AD2 for ; Wed, 13 Mar 2019 08:57:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B46C29AD5; Wed, 13 Mar 2019 08:57:47 +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 1D7B329AD2 for ; Wed, 13 Mar 2019 08:57:47 +0000 (UTC) Received: from localhost ([127.0.0.1]:40658 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3zhq-00052R-Ct for patchwork-qemu-devel@patchwork.kernel.org; Wed, 13 Mar 2019 04:57:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3zg4-0003LJ-VH for qemu-devel@nongnu.org; Wed, 13 Mar 2019 04:55:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3zY8-0005Vn-L2 for qemu-devel@nongnu.org; Wed, 13 Mar 2019 04:47:45 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:37233) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3zY8-0005U9-EH for qemu-devel@nongnu.org; Wed, 13 Mar 2019 04:47:44 -0400 Received: by mail-wr1-x443.google.com with SMTP id y15so990476wro.4 for ; Wed, 13 Mar 2019 01:47:42 -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=3xWbK+cf59pdg/jJAcewyR4c1JH0Cz+jH6tRL0PeMMQ=; b=hdLHCEAgbWZMnj6pA85h5G07HUWjQbmJLT7svslAchrQiussB0O5TzC+XZ0ihuTID3 uuFfG5vjYswIU88Yga8jNZ1OhtU1pKlE70yfQ+5/MxJRjjLXk6+cMEHYf+Uou2TtbRVD jHlWVjsIlWFXcT4qMAzG8hK2wFJuPgGM7D0/egkFYOr8XJ34nr1K7ztakecAbM6g5hIz 6+t9YUgESy69PyAns7JxuuJRgwYgHer3i6lLg53WCJ8habJWsKBg9dTEY/Y/Qmjr3nNR FfNBROTxXF6aQDtZOwe6+Ji1+2MbHDlGKiVmdKQhqFRdtYjL4MJZmXKJGW6OANhc07zU DAVw== 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=3xWbK+cf59pdg/jJAcewyR4c1JH0Cz+jH6tRL0PeMMQ=; b=eWIzjjRmL1d+qWN0yX+RdqgmbngRWRKQCz1fgQaYZSBRV5wPPnJvUjR2edkkV2lyP6 Q30DMXGgXvBuXjqKyhLoUWwfb5/moO9NcQXySHFRSxcYbeQ03Dj3G+CPjqSL6qSdAkiA 1TYEY0/uLv494hvfsjLCmYQNXiULct7B8txUSlyRakpNrhRww6wtqWibMUhSRZ2AzUUt f8LPxORqtOdVPCU4yyh673jxVUfcyKercy3AOsGCV22TlI/9DU8ndPfnB0988Cjr1Myu hakTFkkW0nTFxDn7F0knLpQTPb8KbhDLMdLugAjmZfp5qulVrfixFU+mPKuXbrInSC4m BjuA== X-Gm-Message-State: APjAAAWWdTOkptot6xWjLxttIH8o7u8TCrB60/N8Ce/PAfKZPJhmQskO FJS1KrHTNr9CSWeEid92xBTjdKaf X-Google-Smtp-Source: APXvYqw80SeqaSXodRPopqBjaFeh74ojHBQHALIubWHu4YIdclQNMVe2w3nqFHN233ikZhlYQJ5SNg== X-Received: by 2002:adf:f2c9:: with SMTP id d9mr12251430wrp.308.1552466861336; Wed, 13 Mar 2019 01:47:41 -0700 (PDT) Received: from kheib-workstation.redhat.com ([192.116.94.220]) by smtp.gmail.com with ESMTPSA id o18sm37683587wrg.40.2019.03.13.01.47.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Mar 2019 01:47:40 -0700 (PDT) From: Kamal Heib To: qemu-devel@nongnu.org Date: Wed, 13 Mar 2019 10:46:48 +0200 Message-Id: <20190313084648.9513-5-kamalheib1@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190313084648.9513-1-kamalheib1@gmail.com> References: <20190313084648.9513-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::443 Subject: [Qemu-devel] [PATCH 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. Signed-off-by: Kamal Heib Reviewed-by: Yuval Shaia Reviewed-by: Yuval Shaia --- 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,