Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3118028pxb; Fri, 12 Feb 2021 09:34:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJxPrcdxXvSU/J9aleU0wXKFucRsR2xcgqlW0HUZjpDTNzWOwOjX6LeL0QrquBpsNzCGyTnj X-Received: by 2002:aa7:ce96:: with SMTP id y22mr4439833edv.369.1613151284745; Fri, 12 Feb 2021 09:34:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613151284; cv=none; d=google.com; s=arc-20160816; b=XEXABcem28VBEI9Vcls7jP3AeUJj8vG528HblIvrRKRe/oIEfPipR6a+/uoat4di3g y9f3HucOwW4SbC0B1uqal4xQb+y6v8tZlLT8aexme0kBsDwcMqSXGrFZ0poXCXrOambm AZirtNqgCDvGRqe9zTokcJX02DDTCuz/GtK6W3vO6UydFs34dmrViQkw0zM2hRzsVSpw GjJ603BVN5XVTnUEMs2AX7AryTOajSX38R7qtqQ8xYBDVW6t/G2vANXv1o8VeiTb+7LM hUAm4461veF+jqRRiGTXKEPa5ZQpo48/lUl2L2Y74PO0DDyj7MOumx7Z0Rhcwf7kfTTV upDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=pm/HhctxAwmjhEKA8bUvx+RIZ+9pCjbVW6Pg93SlqQ4=; b=b1Gpb6BfcR+IZJ1BAxmNdtvtSCHGMRNTEiR5UK8t466WLPZr99sc4CMcUA2PPRVnce XwPsThFdBYBQy2EE9afeGCVMAIi7/uuR/pH3qdhXhTHKsvewZw4/iK7gg4/TUr5JAfMU LPeLH3EuhOjPOWc45vqqqsdUbF6GpTpB2lqI8pcerxKEzd1yFsiBulUgRg5OUBlGkinZ HvwAowMwqUI8bm3EFwrcORqbzTquUcjNGiDDUxH3/7UCvODBzzQKFmOEh8MA71zD2yec XY6spHJ7+18zpSYZQNIuGg0pZk32n3PsXxoUcPOZXYqnx0AFO6xCX2I1zlMXNVZ4ldl0 2l4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g25si6512740edr.526.2021.02.12.09.34.21; Fri, 12 Feb 2021 09:34:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231639AbhBLRaY (ORCPT + 99 others); Fri, 12 Feb 2021 12:30:24 -0500 Received: from szxga02-in.huawei.com ([45.249.212.188]:3441 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231327AbhBLR3X (ORCPT ); Fri, 12 Feb 2021 12:29:23 -0500 Received: from DGGEMM404-HUB.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4DcgRM2rSbz5RKj; Sat, 13 Feb 2021 01:27:11 +0800 (CST) Received: from dggemm751-chm.china.huawei.com (10.1.198.57) by DGGEMM404-HUB.china.huawei.com (10.3.20.212) with Microsoft SMTP Server (TLS) id 14.3.498.0; Sat, 13 Feb 2021 01:28:37 +0800 Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by dggemm751-chm.china.huawei.com (10.1.198.57) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Sat, 13 Feb 2021 01:28:36 +0800 Received: from lhreml710-chm.china.huawei.com ([169.254.81.184]) by lhreml710-chm.china.huawei.com ([169.254.81.184]) with mapi id 15.01.2106.006; Fri, 12 Feb 2021 17:28:34 +0000 From: Shameerali Kolothum Thodi To: Robin Murphy , "linux-kernel@vger.kernel.org" , "iommu@lists.linux-foundation.org" CC: "joro@8bytes.org" , "jean-philippe@linaro.org" , "will@kernel.org" , "Zengtao (B)" , "linuxarm@openeuler.org" Subject: RE: [PATCH v2] iommu: Check dev->iommu in iommu_dev_xxx functions Thread-Topic: [PATCH v2] iommu: Check dev->iommu in iommu_dev_xxx functions Thread-Index: AdcBTrfjz4ngs6VWSn6F9Rp3qrl5mQADsiaAAAAQ0NAAAVXqEA== Date: Fri, 12 Feb 2021 17:28:34 +0000 Message-ID: <33cf95925cfb47dda3ee472e00b9846c@huawei.com> References: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.47.89.255] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogU2hhbWVlcmFsaSBLb2xv dGh1bSBUaG9kaQ0KPiBTZW50OiAxMiBGZWJydWFyeSAyMDIxIDE2OjQ1DQo+IFRvOiAnUm9iaW4g TXVycGh5JyA8cm9iaW4ubXVycGh5QGFybS5jb20+OyBsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwu b3JnOw0KPiBpb21tdUBsaXN0cy5saW51eC1mb3VuZGF0aW9uLm9yZw0KPiBDYzogam9yb0A4Ynl0 ZXMub3JnOyBqZWFuLXBoaWxpcHBlQGxpbmFyby5vcmc7IHdpbGxAa2VybmVsLm9yZzsgWmVuZ3Rh byAoQikNCj4gPHByaW1lLnplbmdAaGlzaWxpY29uLmNvbT47IGxpbnV4YXJtQG9wZW5ldWxlci5v cmcNCj4gU3Vi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