Received: by 10.223.185.116 with SMTP id b49csp674096wrg; Tue, 20 Feb 2018 06:06:24 -0800 (PST) X-Google-Smtp-Source: AH8x225jmJYsfbD4F3yatFQ3aoj8qih6BI0kaGxXAZ4Ks11LHVG5PtIVcJfY9y8S2HP4AQMR3lXw X-Received: by 10.167.129.195 with SMTP id c3mr18107918pfn.14.1519135584064; Tue, 20 Feb 2018 06:06:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519135584; cv=none; d=google.com; s=arc-20160816; b=f3MLWpNMjbL9D/Frb2v2ze3SCOY2Q6BOKlMXul+plswIfbFLWJNcdMzeHeJRLvdQYY ToOb9QGj97ITQbIfQvsj2g5JySixFAC0azXOeioC2VWVH5MG7dHsls/rzyZMwIrU9JVD nbpwobJd4z9aPzptpryVTZQh9WM7X3QvvJnhCLvFTqRIVfth5SfRFqFmekZRP39m5ykH FkM3PolQ4+10m7JggPUBGCoxfBALmGx3KMPkXIcpEdjWwWpAydCSnXnhFTjB3jS09q23 KxBm6PJWY8QUeGo53Q45xtSIPQw1roy8h8khYHFVc81Lp7AtZGlCMVnuLWv3sTwvOiyU LRCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=qKrXXR13+HWZ2jjMNW5jWUadIBRIP5M1eU3oXQUTJ9M=; b=kw1sHR5GQGk4ZxgsSTyCm55y6K1id1s3d7BHJjWgwutUZ1QwJrY/9+i+mwPPzuvZXo eTBxqLxcYVMTxweW2tAP94t1Adi8d0OuhQ083hGQtraIGQ/Ry8aqfzn5OAj0qUEKzkvx 7HFu0hHZOXzGYc4uUfZCPSMcerlaeQTbscPFKsRtqGccSYlYvDgrpGtWGQF7BGztT9Wp YnYZ0NR7w3EngZ1GJpX6B4/6K7hfb6QVoNnCxMbIBHmiaIlleyvHMD3yIu2P8yv2KDKW j/6aTYn5CcHVdioFJkQXLSzKe8n2qqV3NfzZJQUChZv9859uhJTrIkG65k9Nv0hGQtsL IHAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=e5szd2T2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o184si891271pga.245.2018.02.20.06.06.09; Tue, 20 Feb 2018 06:06:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=e5szd2T2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751803AbeBTOE5 (ORCPT + 99 others); Tue, 20 Feb 2018 09:04:57 -0500 Received: from mail-qt0-f181.google.com ([209.85.216.181]:37011 "EHLO mail-qt0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751317AbeBTOE4 (ORCPT ); Tue, 20 Feb 2018 09:04:56 -0500 Received: by mail-qt0-f181.google.com with SMTP id d26so16451909qtj.4; Tue, 20 Feb 2018 06:04:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=qKrXXR13+HWZ2jjMNW5jWUadIBRIP5M1eU3oXQUTJ9M=; b=e5szd2T2MQ2LhR897OvKAlqs55prCn1uThh6kCs73CTJNZJsEoBfXrBRXfKv783bNT w3Y2NtY3l3tDU5YzcGShhhiY2DqXA+DOLuUl9vAQ63Y45f3+9yuDhN5W15LgnAymivJB L1c6sUz3N+W1pbyuu5U1vlgF3RL8+P4098Ktlpg4YatvIGmIVQWEvlOGraSZZ8nrbzcl 2SB/T3uIgXS0aDrrwAmKSk2wpsnrYRjPZTzkKTLSSuQYVWOl+asuqxj0e5t+e9BZ24wF 6CX852i6niTSiCvVywLWbOqY0ODMJYGPBIUcNZU7twDU4Kg5LDKwFVZOfS9GmD2NvPF9 y8/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=qKrXXR13+HWZ2jjMNW5jWUadIBRIP5M1eU3oXQUTJ9M=; b=DhIAZeX2tqdjlC401cfxnWl5qUpw5byKFM63AONvaS3v1SucgiOZEkt/GotPp0V8H3 GSbl2jscb+to2F45RsPjmz4yL/2G8OFxcRqpTVAF/chBEZ4rGH6R6pZYpF5jdq1mLmDI jJQRzT/ddKjA6JeGc2Q7ggd6piBNHx57uXkkW/rrHpLc+zkY5yeGyNptKoKqDTPj2ZRV EYSQM7yuHzbz55d6F9ciKsHJ7QaahICzxm7ZASltecO5QwnaO8AIY6XEsRRQrxLBxsn7 S7khhG7YlTmHx0A5dT/cS5j3MrWFXWzbjFP6D3f3dm0+KtXRQh0IoAGAybqgqZk52V7P bY+w== X-Gm-Message-State: APf1xPAzGdwO0DGXrKBwVsChRaeRi7R/E70coF95IR83yS0kvLo97DHM +mQ/oru3gCuuQGFy5VOj4fFjRD45QbyduCLlZ9A= X-Received: by 10.200.26.79 with SMTP id q15mr29170924qtk.174.1519135495602; Tue, 20 Feb 2018 06:04:55 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.195.80 with HTTP; Tue, 20 Feb 2018 06:04:54 -0800 (PST) In-Reply-To: <20180220085813.1897-1-christian.koenig@amd.com> References: <20180220085813.1897-1-christian.koenig@amd.com> From: Andy Shevchenko Date: Tue, 20 Feb 2018 16:04:54 +0200 Message-ID: Subject: Re: [PATCH] PCI: stop crashing in pci_release_resource To: =?UTF-8?Q?Christian_K=C3=B6nig?= Cc: Bjorn Helgaas , Linux Kernel Mailing List , linux-pci@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 20, 2018 at 10:58 AM, Christian K=C3=B6nig wrote: > Is it entirely possible that the BIOS wasn't able to assign resources to > a device. In this case don't crash in pci_release_resource() when we try > to resize the resource. > struct resource *res =3D dev->resource + resno; > > + if (!res->parent) > + return; > + > dev_info(&dev->dev, "BAR %d: releasing %pR\n", resno, res); I would find info message is useful even in such case. > release_resource(res); > res->end =3D resource_size(res) - 1; --=20 With Best Regards, Andy Shevchenko