Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3083419pxb; Fri, 12 Feb 2021 08:46:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJzHjrRvh3KMqoz4fhQ7l9KwcizmG5utnmsApPhZQ0PFKVinJ0caFuoNnSUi5UzM6+k6T5nX X-Received: by 2002:aa7:d906:: with SMTP id a6mr4299731edr.74.1613148387316; Fri, 12 Feb 2021 08:46:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613148387; cv=none; d=google.com; s=arc-20160816; b=nox00t8yyzvUExl7Vxif45aFyWKXwf7hRPFOIkL0glMxEhI2sslh7fnwNzFdm/wAuq ooYXwLmoNmrTjsW0PbsAbtY65nSqocqvTyGmrgr/fRvlQ4Yk7Vcl1JhKsPb41MmNFOLU XyrhxrbxM1CAmkwnp/bU2GTFHGz/tkrdmc6QtJv4Y5QFYa1QeH1pIXQIhVEgaudSQs+w Lokoxq8xbVzyMIo0eyIgk7QZL1dTk1NkR+sBpU65ikAASkK5EZRlbqvQRAG55S8KdakA uoCGL2MjgBZpJAULJTMBy+nfT6TsUzBR9CoKMnas/G/2/v7/b3fg7POGmVZVr60nnNKm Do6w== 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:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=a5Zyq0463hT/iDbGOOLV6EKJurgHIzbf+P/8rE//QWA=; b=euBiTVEkUs/EjgmBLQ9PzsWMECW45GAP7iZTgs7labmZDUqBEquDaKaxiDgTp1wWQG OLMe3gaLqiReqkx1Am+1akiMuJuclwa1dHN+qfZc0BIAnj2SWlnxcF5n1B/LvK4sPEpM DjjHd0HzOVS3wS5MBx+szOK2QnCFyEk1FScW3bu3QBTLyRNTHyXx551nhSrK15l6rHKp im8gaQVx59GSO1Datr5tzgpxS2N4V9lEWIUXgBRepLZyCFY33Kht1cmzNQsylvfd4OBo Taw6j2+JQO/k5tgLmkf9NwDEtW/LY2bNoPyKO/A+32c6WINHhohTpIDDHAriqqqa2q1F Fgfg== 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 hs7si7708170ejc.128.2021.02.12.08.46.02; Fri, 12 Feb 2021 08:46:27 -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 S230491AbhBLQph (ORCPT + 99 others); Fri, 12 Feb 2021 11:45:37 -0500 Received: from szxga08-in.huawei.com ([45.249.212.255]:2839 "EHLO szxga08-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230172AbhBLQpf (ORCPT ); Fri, 12 Feb 2021 11:45:35 -0500 Received: from DGGEMM402-HUB.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4DcfRp21Rgz13t1p; Sat, 13 Feb 2021 00:42:30 +0800 (CST) Received: from dggemm751-chm.china.huawei.com (10.1.198.57) by DGGEMM402-HUB.china.huawei.com (10.3.20.210) with Microsoft SMTP Server (TLS) id 14.3.498.0; Sat, 13 Feb 2021 00:44:49 +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 00:44:48 +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 16:44:46 +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: AdcBTrfjz4ngs6VWSn6F9Rp3qrl5mQADsiaAAAAQ0NA= Date: Fri, 12 Feb 2021 16:44:46 +0000 Message-ID: <501a26a47f6649fc8920d0a308009a5d@huawei.com> References: In-Reply-To: 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 DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogUm9iaW4gTXVycGh5IFtt YWlsdG86cm9iaW4ubXVycGh5QGFybS5jb21dDQo+IFNlbnQ6IDEyIEZlYnJ1YXJ5IDIwMjEgMTY6 MzkNCj4gVG86IFNoYW1lZXJhbGkgS29sb3RodW0gVGhvZGkgPHNoYW1lZXJhbGkua29sb3RodW0u dGhvZGlAaHVhd2VpLmNvbT47DQo+IGxpbnV4LWtlcm5lbEB2Z2VyLmtlcm5lbC5vcmc7IGlvbW11 QGxpc3RzLmxpbnV4LWZvdW5kYXRpb24ub3JnDQo+IENjOiBqb3JvQDhieXRlcy5vcmc7IGplYW4t cGhpbGlwcGVAbGluYXJvLm9yZzsgd2lsbEBrZXJuZWwub3JnOyBaZW5ndGFvIChCKQ0KPiA8cHJ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