From patchwork Sun Feb 11 15:09:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniil Dulov X-Patchwork-Id: 13552504 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 lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CDA6CC4829A for ; Sun, 11 Feb 2024 15:38:37 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.679070.1056584 (Exim 4.92) (envelope-from ) id 1rZBuG-0004wY-G4; Sun, 11 Feb 2024 15:38:12 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 679070.1056584; Sun, 11 Feb 2024 15:38:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rZBuG-0004wR-DC; Sun, 11 Feb 2024 15:38:12 +0000 Received: by outflank-mailman (input) for mailman id 679070; Sun, 11 Feb 2024 15:10:20 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rZBTI-0002dl-Dr for xen-devel@lists.xenproject.org; Sun, 11 Feb 2024 15:10:20 +0000 Received: from mail-out.aladdin-rd.ru (mail-out.aladdin-rd.ru [91.199.251.16]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id a6f06610-c8ef-11ee-98f5-efadbce2ee36; Sun, 11 Feb 2024 16:10:13 +0100 (CET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a6f06610-c8ef-11ee-98f5-efadbce2ee36 From: Daniil Dulov To: Juergen Gross CC: Daniil Dulov , Boris Ostrovsky , Konrad Rzeszutek Wilk , Stefano Stabellini , Jeremy Fitzhardinge , , , , Subject: [PATCH] swiotlb-xen: remove redundant NULL check Date: Sun, 11 Feb 2024 07:09:58 -0800 Message-ID: <20240211150958.4112-1-d.dulov@aladdin.ru> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.0.20.125] X-ClientProxiedBy: EXCH-2016-03.aladdin.ru (192.168.1.103) To EXCH-2016-01.aladdin.ru (192.168.1.101) In this case hwdev cannot be NULL, so remove redundant NULL check. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: b097186fd29d ("swiotlb-xen: SWIOTLB library for Xen PV guest with PCI passthrough.") Signed-off-by: Daniil Dulov --- drivers/xen/swiotlb-xen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index 2b385c1b4a99..b166f6efea26 100644 --- a/drivers/xen/swiotlb-xen.c +++ b/drivers/xen/swiotlb-xen.c @@ -305,7 +305,7 @@ xen_swiotlb_alloc_coherent(struct device *hwdev, size_t size, if (!ret) return ret; - if (hwdev && hwdev->coherent_dma_mask) + if (hwdev->coherent_dma_mask) dma_mask = hwdev->coherent_dma_mask; /* At this point dma_handle is the dma address, next we are