From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E6819A04BB for ; Tue, 6 Oct 2020 12:05:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CD6002B82; Tue, 6 Oct 2020 12:05:00 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by dpdk.org (Postfix) with ESMTP id C2BB037B7 for ; Tue, 6 Oct 2020 12:04:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601978698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nNYR7p79hmRbI+FiOrOY8Xa3FUx+RAOhq+SOjlc1ObQ=; b=XPMFGSKFEQw493X739LBpeY0Hh3RdkWSbc6Cs3vHAsqs9gsJSR246viMXdFMQCtHR2ZAE2 /kZ1egMflWOIbXLXXbp1Qj9cdQBsFWxgdwyzzqt8Wpf8kjCFDuQhjQ8Al/F37dePIxylnS MZLmnFlWEjbn6WPBgN1OSObTIuzf3kQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-420-GEK7IB2rOYKUJ5EaqRhrkg-1; Tue, 06 Oct 2020 06:04:56 -0400 X-MC-Unique: GEK7IB2rOYKUJ5EaqRhrkg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A50D18B8D25; Tue, 6 Oct 2020 10:04:46 +0000 (UTC) Received: from localhost.localdomain (unknown [10.36.110.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 664012B3A8; Tue, 6 Oct 2020 10:04:44 +0000 (UTC) From: Maxime Coquelin To: dev@dpdk.org, stable@dpdk.org, nicolas.chautru@intel.com, trix@redhat.com Cc: Maxime Coquelin Date: Tue, 6 Oct 2020 12:04:21 +0200 Message-Id: <20201006100421.72210-3-maxime.coquelin@redhat.com> In-Reply-To: <20201006100421.72210-1-maxime.coquelin@redhat.com> References: <20201006100421.72210-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Subject: [dpdk-stable] [PATCH 2/2] baseband/fpga_lte_fec: fix segfaults with debug X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" When RTE_LIBRTE_BBDEV_DEBUG is enabled, rte_device's driver pointer is dereferenced twice in fpga_lte_fec's probe callback. It causes a segmentation fault because this pointer is only assigned after probe callback call. This patch makes use of rte_pci_driver pointer instead Fixes: efd453698c49 ("baseband/fpga_lte_fec: add driver for FEC on FPGA") Cc: stable@dpdk.org Signed-off-by: Maxime Coquelin --- drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c index 37018b9c7f..c80721be96 100644 --- a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +++ b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c @@ -2328,7 +2328,7 @@ fpga_lte_fec_init(struct rte_bbdev *dev, struct rte_pci_driver *drv) rte_bbdev_log_debug( "Init device %s [%s] @ virtaddr %p phyaddr %#"PRIx64, - dev->device->driver->name, dev->data->name, + drv->driver.name, dev->data->name, (void *)pci_dev->mem_resource[0].addr, pci_dev->mem_resource[0].phys_addr); } @@ -2383,7 +2383,7 @@ fpga_lte_fec_probe(struct rte_pci_driver *pci_drv, ((uint16_t)(version_id >> 16)), ((uint16_t)version_id)); #ifdef RTE_LIBRTE_BBDEV_DEBUG - if (!strcmp(bbdev->device->driver->name, + if (!strcmp(pci_drv->driver.name, RTE_STR(FPGA_LTE_FEC_PF_DRIVER_NAME))) print_static_reg_debug_info(d->mmio_base); #endif -- 2.26.2