From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0E053A055B; Thu, 20 Oct 2022 13:32:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 014A242C5C; Thu, 20 Oct 2022 13:32:24 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 72ED742BF1 for ; Thu, 20 Oct 2022 13:32:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666265543; 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: in-reply-to:in-reply-to:references:references; bh=bxZ3fn54JFvz1e4/CnGv4LVTaZvXfUnydtR6Lh7TXhc=; b=UzVavcthnJdJTJNDhsXQ1EGk4BhFLNRNdEUUiO9mjiOrYu3VpM/LriPBwfOC+YSd/JDmE4 On/HX18Bdunh1Tzb0p43Di42Kb0y47TkudIGrTblKGkYypjKrowk8Bp+N4tXY+NkcC6Qeo 7FoCbRUOhdkuLa8aGOyI5mmbKkXwuLY= Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-605-EfYfKd_HNUep70MJJtLdSA-1; Thu, 20 Oct 2022 07:32:21 -0400 X-MC-Unique: EfYfKd_HNUep70MJJtLdSA-1 Received: by mail-pg1-f198.google.com with SMTP id 83-20020a630156000000b0046b208f6ae3so10015014pgb.16 for ; Thu, 20 Oct 2022 04:32:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bxZ3fn54JFvz1e4/CnGv4LVTaZvXfUnydtR6Lh7TXhc=; b=BPX5/I+Ll0T/bsYXyXSPH8wst2CqsRbUxp0ZIicTOcT/ws5zK3JDgIGvbmrsLrlfKE JS2KNMeDfNFTVOGzAEnl8rTDO5US8KuRrCawvo4uPmx4J/vSGQX3a0G4eghvBIHg6os4 I/xqNv9nBQHLHKbMRyf5+bmDMFnBnuwdygS3qKFbeWxnGBjUNfvDg8oVJh9nttSYVB2a WuUXC/PV95u1VhknIStPnMosOCgsNYKxmXbCX1OIMmM8QjSCSYVaTgVyqG8LG4mQzPBq 9KQH5Db6e+l3VW8q1OQKi8+vQSoKsAwxJDMpZUd8F96ZGSiUOAHLW2M0S9Fd0KEu9ky8 tWHA== X-Gm-Message-State: ACrzQf3t3PUBKoByZrMAwFjcJp3H0vjE3/nbr13C1qIIaiJnYStA+TpK iyaJSFfvCfpTU3N4Oygo3hy/id21CXXyqvX8x0H2kAeTEPlrcIyY0P5aAeBSexuMO0svtNuTF6f EMk8cGEfhS3Tggq8RJws= X-Received: by 2002:a05:6a00:1f10:b0:562:b9e1:55e9 with SMTP id be16-20020a056a001f1000b00562b9e155e9mr13341615pfb.60.1666265540860; Thu, 20 Oct 2022 04:32:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7lfq46qy4VkqNA8AD2crp4Dp3fgc62yAR7N2WLgoFQWrLvcIFJWAtpWi2H74nhoLDTWacLWrtQJWVP6+gDLfs= X-Received: by 2002:a05:6a00:1f10:b0:562:b9e1:55e9 with SMTP id be16-20020a056a001f1000b00562b9e155e9mr13341590pfb.60.1666265540608; Thu, 20 Oct 2022 04:32:20 -0700 (PDT) MIME-Version: 1.0 References: <20221019104847.1699872-1-zhangfei.gao@linaro.org> <20221019140801.1700392-1-zhangfei.gao@linaro.org> In-Reply-To: <20221019140801.1700392-1-zhangfei.gao@linaro.org> From: David Marchand Date: Thu, 20 Oct 2022 13:32:09 +0200 Message-ID: Subject: Re: [PATCH v2 resend] bus/vdev: vdev_cleanup checks dev->device.driver To: Zhangfei Gao Cc: Anatoly Burakov , Akhil Goyal , Fan Zhang , dev@dpdk.org, acc@openeuler.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Wed, Oct 19, 2022 at 4:14 PM Zhangfei Gao wrote: > > vdev_probe calls driver->probe and set dev->device.driver, > which will be NULL if the probe fails. > > In vdev_cleanup, drv = container_of(dev->device.driver) > drv will be !NULL in this case, causing drv->remove > Segmentation fault. > > Fixed by checking dev->device.driver before. > > Log: > $ sudo dpdk-test --vdev=crypto_uadk --log-level=6 > vdev_probe(): failed to initialize crypto_uadk device > EAL: Bus (vdev) probe failed. > RTE>>quit > Segmentation fault > > Fixes: 1cab1a40ea9b ("bus: cleanup devices on shutdown") > Signed-off-by: Zhangfei Gao Reviewed-by: David Marchand Applied, thanks. -- David Marchand