From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rcdn-iport-9.cisco.com (rcdn-iport-9.cisco.com [173.37.86.80]) by dpdk.org (Postfix) with ESMTP id 571F02A62 for ; Thu, 9 Jun 2016 20:56:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=978; q=dns/txt; s=iport; t=1465498576; x=1466708176; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=wzT27uXVoJ9CG8NtVv34dYYjvMaUyPdQR9uEbTSMO30=; b=OWOBhi0dlAz52+FWfjSj/aVdsa6Dji5DpKa2QxI3aMswwABVIKDuWkGp NmE8rrhnjN4avNvf0AQNtlTYLJFI69rxSVkSaV4AmE5BrkPfUsQfI/9yC lwSAPbpb0bipbOAiN3B7FvEwWkcH71rpRB8eynZ2VEaqrOGRIlR+msLmC 8=; X-IronPort-AV: E=Sophos;i="5.26,446,1459814400"; d="scan'208";a="111289376" Received: from alln-core-6.cisco.com ([173.36.13.139]) by rcdn-iport-9.cisco.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 09 Jun 2016 18:56:15 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by alln-core-6.cisco.com (8.14.5/8.14.5) with ESMTP id u59IuFJV029995; Thu, 9 Jun 2016 18:56:15 GMT Received: by cisco.com (Postfix, from userid 392789) id 637863FAAE23; Thu, 9 Jun 2016 11:56:15 -0700 (PDT) From: John Daley To: bruce.richardson@intel.com Cc: dev@dpdk.org, John Daley Date: Thu, 9 Jun 2016 11:56:08 -0700 Message-Id: <1465498569-5857-2-git-send-email-johndale@cisco.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1465498569-5857-1-git-send-email-johndale@cisco.com> References: <20160609160808.GJ12520@bricha3-MOBL3> <1465498569-5857-1-git-send-email-johndale@cisco.com> Subject: [dpdk-dev] [PATCH v3 1/2] enic: fix seg fault when releasing queues X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 18:56:16 -0000 If device configuration failed due to a lack of resources, such as if more queues are requested than are available, the queue release function is called with NULL pointers which were being dereferenced. Skip releasing queues if they are NULL pointers. Fixes: fefed3d1e62c ("enic: new driver") Signed-off-by: John Daley --- v3: bail out of free rq function if rq is null instead of if around != NULL. drivers/net/enic/enic_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 996f999..5939b9d 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -429,6 +429,9 @@ void enic_free_rq(void *rxq) struct vnic_rq *rq = (struct vnic_rq *)rxq; struct enic *enic = vnic_dev_priv(rq->vdev); + if (rxq == NULL) + return; + enic_rxmbuf_queue_release(enic, rq); rte_free(rq->mbuf_ring); rq->mbuf_ring = NULL; -- 2.7.0