From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 45239C433F5 for ; Wed, 13 Apr 2022 15:13:11 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A6A0883DBD; Wed, 13 Apr 2022 17:13:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="IqY8Qk/v"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8D30D83DBD; Wed, 13 Apr 2022 17:13:08 +0200 (CEST) Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com [IPv6:2607:f8b0:4864:20::b34]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9D9C183D9E for ; Wed, 13 Apr 2022 17:13:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-yb1-xb34.google.com with SMTP id i20so4303715ybj.7 for ; Wed, 13 Apr 2022 08:13:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HPT36UyZpqW6i8jWmyICm4oTrpr2I5fS3fV8opAZeMg=; b=IqY8Qk/v4M6l9JcSdkVDA5rl2uPGa/9lDkpWnIQySGOd/1buosNLTvPTVJoaWDw5gc pyp8cmj71bSmVNHvv/DE8Pu5VCJTY2KaJE7EL5pfBdNugaln8mXaGqi+PFzGwrOF4Z2X SvBAO3a52rGX5+iwyUOtFZT686F66IZQMt017InTNChZnZh+lH9sHvVDdGjwzcbstYCO DP9e5F2TdrJCYpCjd/J3YTP9VxOJwAiWfWf8ebHbWsXbj7yVgiWhn4JdoljJgSsevXwo Iwlxf1a2u0eK/fPxojcQ7PfIqds9S+8BBDLOd8tf6NUNS57RbIie5ZckLnsrTzQCMrm0 iSnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HPT36UyZpqW6i8jWmyICm4oTrpr2I5fS3fV8opAZeMg=; b=IQzWYRiLZixOgO3qbSopP9wrX7sp9sItG0XBfv8CJaGOvRrA3WxpDQySdQBxfQm1VN MG+dDcahZjYLrk9qUALml4G//Po/tJs9uiOCsrNVSSm4qOW3AHsJJOYop2hblBS/uhIz hh7NT78tVv53lIQIuA57Q7vOWGnN6mV1GC7j00hRVxBG6C53l5QTz7lYj83QFiZY91+N p9q3d2aciubikX6Q85k6neHAjnd4/4Eve+jrPttbimMbgx/vV3oFTkcnAwI8rfnTpnHl 2/b0VH7ZAat6wW2WF3zSIBEtD8h8Hl0/IyQg3901bZorpYimJf0tVT3RLXt0hk4N46Jy qi4w== X-Gm-Message-State: AOAM5306cJyjnU5dQCUg09kjvM5miJsK8NZCYci9KLM5DW8dQrVrYo8W GhBy169kySe0QxXVkzjMj7nidFnXiv2CjND6rDl4I9y8uLo= X-Google-Smtp-Source: ABdhPJydFDbZvETIURu+oVQJn9JxjhVGY+ccTfyTuWmUpDEu0T0xSt6Bqh2yvtJsmKUW9gAB47ufOgcNlDG70PS26H0= X-Received: by 2002:a05:6902:1508:b0:641:8ce0:6e45 with SMTP id q8-20020a056902150800b006418ce06e45mr9440634ybu.104.1649862784567; Wed, 13 Apr 2022 08:13:04 -0700 (PDT) MIME-Version: 1.0 References: <20220329165900.1139885-1-ascull@google.com> <20220329165900.1139885-18-ascull@google.com> In-Reply-To: <20220329165900.1139885-18-ascull@google.com> From: Bin Meng Date: Wed, 13 Apr 2022 23:12:53 +0800 Message-ID: Subject: Re: [PATCH v2 17/18] virtio: pci: Check virtio configs are mapped To: Andrew Scull Cc: U-Boot Mailing List , Simon Glass , Alistair Delva , Keir Fraser , =?UTF-8?Q?Pierre=2DCl=C3=A9ment_Tosi?= Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean On Wed, Mar 30, 2022 at 12:59 AM Andrew Scull wrote: > > Prepare for calls to `virtio_pci_map_capability()` failing by returning > NULL on error. If this happens, later accesses to the pointers would be > unsafe so cause the probe to fail if such an error occurs. > > Signed-off-by: Andrew Scull > --- > drivers/virtio/virtio_pci_modern.c | 20 +++++++++++++++++--- > 1 file changed, 17 insertions(+), 3 deletions(-) > Reviewed-by: Bin Meng