Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp1226076iol; Fri, 10 Jun 2022 03:03:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFBctgBvB3BiZn7q17UXZIlzHifDmsnW9iT74W1o3TutesJ80xZTjZQuT72plcMPbRAznn X-Received: by 2002:a05:6402:5206:b0:42e:1279:cc8b with SMTP id s6-20020a056402520600b0042e1279cc8bmr47456227edd.186.1654855436871; Fri, 10 Jun 2022 03:03:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654855436; cv=none; d=google.com; s=arc-20160816; b=u6jtN3lSToj2PLnc/RoxCrm/5r1SQHBIJpeaxEmWicV1jDvuBPhu+l79nqxUrdJJ/X 3IykP0CaA7tqeEDlKg7ViD6lC/tDI0dc9EfzE7h0z5Z1UTgD/J/HvRN8HfojKB9WVsht CgylhQRmZM0t0SrbiLi8Cei6juO3fQjeeyQhpDjabDl5qS6TRFyQDlMBHpUFm0NqYUIS NZrJR+0RD6935ed4MM9XzEeeCo46tKra12LkxglwiYO6dxu80MT/GZ49DyY/7UUmAfoT Ert0tcD2MdswYhvAXdsC36yhSzEBGnzrG8G5ZgTEmD8n8Hkn/bTJEWQ2jPGqjuEvXQ0C XzYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=VNvwvZCmu3CH1AnL8IKETWu4CerXgnP3OukVcTtXTjg=; b=GLB6aP/0m7e+1GG+XfgldkpuZhF3r66JtUmbYQdNHw6y9alA1kTffsJLWBz6eGYWpJ rigLnE+n8ww5QVx4EXLNy/p+OBGChLphwnEiDuhl9q2Q/uBemkqJ+r/CIgVzFKt8rcBN NCn8/b2YFPTUoO3R/djExDYGm6IyB050zZcpVtnVyu6Zow4p8OMysn84YUmsX7ltJVP+ br5qSCTyrRqq+YlWajRoDDUNGM6ylQsY/v5mEDh98n1KjMUCdukDOij+F2kiT0rUD7GB DfHEoZ6cUn7TtJeA+/sHtPbcwXrUZIuchnBA+8itwc8WMBkXdg6zNmmXmcLUtN71hlGP Juqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baikalelectronics.ru header.s=mail header.b=OcYV1HpR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=baikalelectronics.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e1-20020a17090681c100b006fee9ca7540si9961501ejx.244.2022.06.10.03.03.22; Fri, 10 Jun 2022 03:03:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@baikalelectronics.ru header.s=mail header.b=OcYV1HpR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=baikalelectronics.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348825AbiFJJTR (ORCPT + 99 others); Fri, 10 Jun 2022 05:19:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240896AbiFJJQT (ORCPT ); Fri, 10 Jun 2022 05:16:19 -0400 Received: from mail.baikalelectronics.com (mail.baikalelectronics.com [87.245.175.230]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3E1B7278529; Fri, 10 Jun 2022 02:15:35 -0700 (PDT) Received: from mail (mail.baikal.int [192.168.51.25]) by mail.baikalelectronics.com (Postfix) with ESMTP id EB5D216C0; Fri, 10 Jun 2022 12:16:12 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.baikalelectronics.com EB5D216C0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baikalelectronics.ru; s=mail; t=1654852572; bh=VNvwvZCmu3CH1AnL8IKETWu4CerXgnP3OukVcTtXTjg=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=OcYV1HpR6moDmjPM1nhkYDN2IJh786364lJZfK8AEnYYBk+FJX8K8k71xz4qePc6G zym7cJmPkM8Vk2BO2U0+0Qfnq6GXNa+EJ+DnuasSMx/obJzWmDwQ2KGLemojAnxfk6 qvVhv8/jdkEyLAff7uZGTT+O3AqB5JjGGQBFWLXo= Received: from localhost (192.168.53.207) by mail (192.168.51.25) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 10 Jun 2022 12:15:20 +0300 From: Serge Semin To: Gustavo Pimentel , Vinod Koul , Rob Herring , Bjorn Helgaas , Lorenzo Pieralisi , Jingoo Han , Frank Li , Manivannan Sadhasivam CC: Serge Semin , Serge Semin , Alexey Malahov , Pavel Parkhomenko , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , , , Subject: [PATCH v3 23/24] dmaengine: dw-edma: Skip cleanup procedure if no private data found Date: Fri, 10 Jun 2022 12:14:58 +0300 Message-ID: <20220610091459.17612-24-Sergey.Semin@baikalelectronics.ru> In-Reply-To: <20220610091459.17612-1-Sergey.Semin@baikalelectronics.ru> References: <20220610091459.17612-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org DW eDMA driver private data is preserved in the passed DW eDMA chip info structure. If either probe procedure failed or for some reason the passed info object doesn't have private data pointer initialized we need to halt the DMA device cleanup procedure in order to prevent possible system crashes. Signed-off-by: Serge Semin Reviewed-by: Manivannan Sadhasivam Tested-by: Manivannan Sadhasivam --- drivers/dma/dw-edma/dw-edma-core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/dma/dw-edma/dw-edma-core.c b/drivers/dma/dw-edma/dw-edma-core.c index 4f56149dc8d8..5736a537f4c8 100644 --- a/drivers/dma/dw-edma/dw-edma-core.c +++ b/drivers/dma/dw-edma/dw-edma-core.c @@ -1040,6 +1040,10 @@ int dw_edma_remove(struct dw_edma_chip *chip) struct dw_edma *dw = chip->dw; int i; + /* Skip removal if no private data found */ + if (!dw) + return -ENODEV; + /* Disable eDMA */ dw_edma_v0_core_off(dw); -- 2.35.1