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 AB31CA0582; Tue, 22 Nov 2022 16:07:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8300242D68; Tue, 22 Nov 2022 16:07:21 +0100 (CET) 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 E34C3427EB for ; Tue, 22 Nov 2022 16:07:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669129639; 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=k31n1jWfBJDdHFtffUZrddY/UlbKZPBkDxrBqJYR9yI=; b=bfvDJB6oUaHSTWg4RqkMUnLx814ZplM3VEY8zcryHXZIrCYRDGkcqBCe+MEKuuXFY5gLM5 oWI28Vy+cPg2bmTnh9szzCuzxVs4EbwajycEau9hYEpGejuaI+KNHdn09grsZO+GVtbRTT ilmoX0Y2sqFu8gZimssuS2zzmXziiA0= Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-433-NOMW1u9YN0-tSAGWaIuUuQ-1; Tue, 22 Nov 2022 10:07:17 -0500 X-MC-Unique: NOMW1u9YN0-tSAGWaIuUuQ-1 Received: by mail-pg1-f200.google.com with SMTP id h185-20020a636cc2000000b0046fc6e0065dso8676488pgc.5 for ; Tue, 22 Nov 2022 07:07:16 -0800 (PST) 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=k31n1jWfBJDdHFtffUZrddY/UlbKZPBkDxrBqJYR9yI=; b=Jo/bgd6NvgS79LQZKcdv9NjvBQlyzAHInb+YsrC0SuwAqrocaApjKWlom28vLnNY/l 3mNInFwLytgN7MbezDTCjgoPNBGVqFxPY9tp868jNSBk2H3s4xx18yNeJ28Ft++2YQHu Okhi/VIJtSB6DLas9d8HRrlEyX7DZga2bbKjO+WW8bnx5nNt5yDRCsGHNn2qRYJztdmi i4heZZVES1bPjICNVDUoRi7XySqmB5jJ0LGLT91PU7SMdekPeYLaiY8nMGGsQuURV6JL PM7BZNzmKKyTBxSAyVDOClkguVo4ol2WBLw4noltVOSqdB4hq4hd3EiiJbIbutDM/xge zNWg== X-Gm-Message-State: ANoB5pk/PsXhJJ+w+yDDB4bIlIL9kIePqGkblWJHeuyDSXhZzyXnjxgy Nmi2PsoVeQOJEsbheaquNW6xynAWrr2xc1tHF63xWnnQJCVDqK5V0PVoAPMAQxRjHAkdYFY83PM 2qYEK8wM3BjwvY/jHH/w= X-Received: by 2002:a17:902:dac2:b0:188:f5c7:4d23 with SMTP id q2-20020a170902dac200b00188f5c74d23mr4746198plx.125.1669129635928; Tue, 22 Nov 2022 07:07:15 -0800 (PST) X-Google-Smtp-Source: AA0mqf5vDSLyvn9Pceuk6kjWhSGByGPYQn2ooNcZB7zb8CAzwneWn4PIjSHLdeVsgRgltw+Udeh3EaHF1GiEBNjv9GA= X-Received: by 2002:a17:902:dac2:b0:188:f5c7:4d23 with SMTP id q2-20020a170902dac200b00188f5c74d23mr4746183plx.125.1669129635650; Tue, 22 Nov 2022 07:07:15 -0800 (PST) MIME-Version: 1.0 References: <20221121111209.2396341-1-david.marchand@redhat.com> In-Reply-To: <20221121111209.2396341-1-david.marchand@redhat.com> From: David Marchand Date: Tue, 22 Nov 2022 16:07:04 +0100 Message-ID: Subject: Re: [PATCH] bus/pci: fix leak with multiple bus scan To: dev@dpdk.org Cc: thomas@monjalon.net, Tomasz Zawadzki , Bruce Richardson 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 Mon, Nov 21, 2022 at 12:12 PM David Marchand wrote: > > The addition of the bus_info field did not account for the fact that the > PCI bus can be scanned multiple times (like for device hotplug and other > uses in SPDK). > Indeed, during pci_scan_one() for devices that were already registered, > the pci_common_set() overwrites the bus_info field, leaking the > previously allocated memory. > > Since the bus_info content is fixed for a PCI device, we can simply skip > allocation if dev->bus_info is already set. > > Fixes: 8f4de2dba9b9 ("bus/pci: fill bus specific information") > > Reported-by: Tomasz Zawadzki > Signed-off-by: David Marchand I did not hear feedback, nor objection. The patch is simple, and it fixes a regression in the release. So I'm taking this patch for rc4. Applied, thanks. -- David Marchand