From patchwork Mon May 9 07:44:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Potnuri Bharat Teja X-Patchwork-Id: 9043041 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B863E9F30C for ; Mon, 9 May 2016 07:44:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D7CDA2010E for ; Mon, 9 May 2016 07:44:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D029320109 for ; Mon, 9 May 2016 07:44:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753107AbcEIHor (ORCPT ); Mon, 9 May 2016 03:44:47 -0400 Received: from stargate.chelsio.com ([12.32.117.8]:46361 "EHLO stargate3.asicdesigners.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752928AbcEIHoq (ORCPT ); Mon, 9 May 2016 03:44:46 -0400 Received: from localhost ([10.193.186.242]) by stargate3.asicdesigners.com (8.13.8/8.13.8) with ESMTP id u497ieO6013892; Mon, 9 May 2016 00:44:41 -0700 From: Potnuri Bharat Teja To: sean.hefty@intel.com Cc: linux-rdma@vger.kernel.org, swise@opengridcomputing.com, nirranjan@chelsio.com, Potnuri Bharat Teja Subject: [PATCH v1 1/1] [librdmacm] examples/rping.c: fix unwanted abort during qp creation Date: Mon, 9 May 2016 13:14:36 +0530 Message-Id: <1462779876-9480-1-git-send-email-bharat@chelsio.com> X-Mailer: git-send-email 2.5.3 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-9.0 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 Memset rping control block structure to 0 to avoid accessing garbage values in the upcoming checks in librdmacm causing unwanted abort during creation of qp. Fixes: b873915aee7b ("librdmacm/rping: Persistent rping server") Signed-off-by: Potnuri Bharat Teja Reviewed-by: Steve Wise --- examples/rping.c | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/rping.c b/examples/rping.c index a5aa8c5f38d6..a0d10779a8b1 100644 --- a/examples/rping.c +++ b/examples/rping.c @@ -759,6 +759,7 @@ static struct rping_cb *clone_cb(struct rping_cb *listening_cb) struct rping_cb *cb = malloc(sizeof *cb); if (!cb) return NULL; + memset(cb, 0, sizeof *cb); *cb = *listening_cb; cb->child_cm_id->context = cb; return cb;