Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp257316rwb; Wed, 14 Dec 2022 17:02:03 -0800 (PST) X-Google-Smtp-Source: AA0mqf5ri5H3GCMtugK+xH3YN7ROxAG7y3sh+9LfrDWY/qxeeMZ5wO3iFWPeQeXnkvqW5Aw8vVoo X-Received: by 2002:a17:906:1858:b0:7ae:d5ab:64ea with SMTP id w24-20020a170906185800b007aed5ab64eamr21403878eje.36.1671066122900; Wed, 14 Dec 2022 17:02:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671066122; cv=none; d=google.com; s=arc-20160816; b=r4h0QQs93etUKIRJAwtjcI0qvGmwTS7ErYYCBsQk0t2JstC4iaVb0fVyjsW1+K5UjN 1bVpixUNh8EV3e62WouQts+we8BiMRZIVfza79/zo5DIxn6ojFDMmXG8gbTeg+7H2xCb a8nL3YVtS8KczwYBxsf569phQ948oqGRQ4zRpcHcufNP5oEFlyVq65JkXYxmlW+I9JEt GVeh2lWM+ElLSBSgK9Ta2yWz3mRLtHVecZ5wTnHZyRCwVRl00sZL6kzd8b4VnohdNB8i 2uIddbB4hwCMOpa14dHSTVxUlR9MlFh8QOCU+kh4sTeCyF6DQbNSNVPLnMGLrG79Z1bz QWZw== 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; bh=81trplEV7jZMsKHGfllYvDtclWPvoPR3tbHl1hqd4nE=; b=JNyqmnrGNJc56b0NkSL5pl58W0YowPdT5p4PmA+qH3U8sf+UHBdIy/1WJE8lW7O9gg OhBhUweRiDRczr1MzGVAYrnzbSpAw3otSPBikieEX4ffOhbM1BH0ZPFsKlDqL/1JyG6V JdjIN23tDx5AWeHc7SMYeuhyfjw4IRIHfEp6nlHZWqh4Oq1Qw/a2cIjZAotGS+R2kHgv DhE/ouJ7HhZWL7t2TnT4gNys9beWTqSlEZ+2OW+4lh5F5KDXgL19SkSFwFMyaawQxdqj 10fgqov2LPRL7ASrSq58BLplEIC6LpEtslKfH2lxqO/MIQUPe5RT0HGf41esFc4zo6KB Kd/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baikalelectronics.ru header.s=post header.b="it0hNd/2"; 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 gn14-20020a1709070d0e00b007c4ec3563c0si3373830ejc.795.2022.12.14.17.01.36; Wed, 14 Dec 2022 17:02:02 -0800 (PST) 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=post header.b="it0hNd/2"; 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 S229911AbiLNXzQ (ORCPT + 69 others); Wed, 14 Dec 2022 18:55:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229819AbiLNXx0 (ORCPT ); Wed, 14 Dec 2022 18:53:26 -0500 Received: from post.baikalelectronics.com (post.baikalelectronics.com [213.79.110.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9120248750; Wed, 14 Dec 2022 15:53:24 -0800 (PST) Received: from post.baikalelectronics.com (localhost.localdomain [127.0.0.1]) by post.baikalelectronics.com (Proxmox) with ESMTP id 318ABE0ED7; Thu, 15 Dec 2022 02:53:24 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= baikalelectronics.ru; h=cc:cc:content-transfer-encoding :content-type:content-type:date:from:from:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=post; bh=81trplEV7jZMsKHGfllYvDtclWPvoPR3tbHl1hqd4nE=; b=it0hNd/2O+tV VLkrquJAeJBQal2eiKBA+k6CgOIGrgLn19QBsEEWHcLsOWc0NIQKPCtxo2Q0Fvyw 1GYO5WXQXN/QUN/P9ys9Ep1SV2Ks7yGoaKv9vRiyitMjFndvkwn7pPPo+U5TOrKe kpFynLaI4J2XoJREk7l28w+ncA2Rg0g= Received: from mail.baikal.int (mail.baikal.int [192.168.51.25]) by post.baikalelectronics.com (Proxmox) with ESMTP id 223D3E0E6B; Thu, 15 Dec 2022 02:53:24 +0300 (MSK) Received: from localhost (10.8.30.6) by mail (192.168.51.25) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 15 Dec 2022 02:53:23 +0300 From: Serge Semin To: Gustavo Pimentel , Vinod Koul , Rob Herring , Bjorn Helgaas , Lorenzo Pieralisi , Cai Huoqing , Robin Murphy , Jingoo Han , Frank Li , Manivannan Sadhasivam CC: Serge Semin , Serge Semin , Alexey Malahov , Pavel Parkhomenko , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , caihuoqing , Yoshihiro Shimoda , , , Subject: [PATCH v7 22/25] dmaengine: dw-edma: Skip cleanup procedure if no private data found Date: Thu, 15 Dec 2022 02:53:02 +0300 Message-ID: <20221214235305.31744-23-Sergey.Semin@baikalelectronics.ru> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221214235305.31744-1-Sergey.Semin@baikalelectronics.ru> References: <20221214235305.31744-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.8.30.6] 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 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 Acked-by: Vinod Koul --- 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 e3671bfbe186..1906a836f0aa 100644 --- a/drivers/dma/dw-edma/dw-edma-core.c +++ b/drivers/dma/dw-edma/dw-edma-core.c @@ -1011,6 +1011,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.38.1