From patchwork Fri Aug 19 06:07:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinpu Wang X-Patchwork-Id: 12948380 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 7C93DC28B2B for ; Fri, 19 Aug 2022 06:10:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Lyfj4kUsGOyMjvAcvlFmf4xyL3wogpaW0OmA0Z54ndo=; b=evwe0z9Lfjqh17 SFVG2WL7eYLC5UhBSvrpGBjeOhWyhmbBAorAQl7Oo2/P2IvNOobZ8kNfKjVIDCUQ9h0AjDQiuwz7X m9Jqjsy/UI1Jhsp0AfyUv0EeNqBNBDKRCc8ZLBPnzNwRZNBOqPYnjREABXZN1x42oQZ6G8A9KS571 tniGjg9fl0EFjdsqWJroehrWi3sr4Bf2SZSzUDRA5D+83uGA0CF/LE4rzBBoW+ZXMtWdm8Q+jDGoQ qjmZnAfULkcqD7HmAI/45PO7tHpTNJXwoY6P/KSrewS/JZ0HpH2gHxEggw3lmzSmm6mavU8amnobj 48ZASCnyQgjvPfxOvChQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOvCR-002Bpo-2Z; Fri, 19 Aug 2022 06:09:43 +0000 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOvBI-0029u3-H7 for linux-arm-kernel@lists.infradead.org; Fri, 19 Aug 2022 06:08:33 +0000 Received: by mail-ej1-x62b.google.com with SMTP id a7so7025459ejp.2 for ; Thu, 18 Aug 2022 23:08:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=nqYvJwkPyhGWw+zs1FTUvC87NAtZOXSQ3RqOerl0RrE=; b=fiuYIZZteuYPevbr1jm85MKPd5CH4K37Lu4s75kvjuumhqQNFhJ070aTDxlo8rddZH i+SLkKBHFRU3yeK8DOPjK8gtAyWibQEuXvJ8eP9IHSg/vRac7WgRAymuwe9+ZobzdLFN PxR14UjJQUSwykQ7XL3yHLtQ4vIhSNDABxzAuHo0Xmno3tATOenqwGlRgr3r4XJhrefO D77YhaODhrbxs5QaR/3iE+LF0FPSh9Ss0hm+76qlQi4ZO1yohXeMcT2tciZbP4zjCTWi ITu0PHFBTopfTT6ON3pqalPDv/DMSFxCS4bqvqWVeoQK7zX6Pur+EiSUCX6SB3Idc4bs hj3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=nqYvJwkPyhGWw+zs1FTUvC87NAtZOXSQ3RqOerl0RrE=; b=k8rOLCxjHodMi8nLENGIfmiAFAeIrUYYeZuwMwqHAQ9hGpLmSiS1NpfQezLRzvFfTl 79BH1WHxuBQuUlbLsCs/H7tIhD0s9Uef4pkTHcYJVUoxLxGo9zzXsiEEtAh+Idi+Yx4z bxDcNbBWjeiusYHI7dRE7v2BTZo/v/W9YtgeEvxhvJTts8TUKLWWVQuPBitqqNZhU1HR d0rjXKx7/2QOxYOdwMrwFUpDyWK+SSwxYhfN1SLW8o+6ex7WbNISF37r8Ziy1NM2mZck OMfO6FMvBYke1lExSPE7LVTiNaOV06didxaI8k05Ttk11/b3GpFAiDzjd+MFnavOuwww 6LZw== X-Gm-Message-State: ACgBeo3StWxW+2Kx/yp5G/TPLlk6oul++PPTc6xQR9HaKvcBEAAqNc73 TSQTwYKcZuhEmWBtI0EeRtuS5Q== X-Google-Smtp-Source: AA6agR63MvipYuGx9P2SlYQNDL6T8+iUmE8z45ilOguyJ5frm1741Qd6zDL+S52D+AlEU7kMb3PpMg== X-Received: by 2002:a17:907:7628:b0:730:b755:4414 with SMTP id jy8-20020a170907762800b00730b7554414mr3907267ejc.11.1660889310244; Thu, 18 Aug 2022 23:08:30 -0700 (PDT) Received: from lb02065.fritz.box ([2001:9e8:143b:fd00:5207:8c7f:747a:b80d]) by smtp.gmail.com with ESMTPSA id y14-20020a1709063a8e00b0073a644ef803sm1809660ejd.101.2022.08.18.23.08.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 23:08:28 -0700 (PDT) From: Jack Wang To: linux-kernel@vger.kernel.org Cc: Ulf Hansson , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org Subject: [PATCH v1 17/19] mmc: meson-mx-sdhc: Fix error check for dma_map_sg Date: Fri, 19 Aug 2022 08:07:59 +0200 Message-Id: <20220819060801.10443-18-jinpu.wang@ionos.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220819060801.10443-1-jinpu.wang@ionos.com> References: <20220819060801.10443-1-jinpu.wang@ionos.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220818_230832_632462_59DCB11B X-CRM114-Status: GOOD ( 13.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org dma_map_sg return 0 on error. Cc: Ulf Hansson Cc: Neil Armstrong Cc: Kevin Hilman Cc: Jerome Brunet Cc: Martin Blumenstingl Cc: linux-mmc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Jack Wang --- drivers/mmc/host/meson-mx-sdhc-mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/meson-mx-sdhc-mmc.c b/drivers/mmc/host/meson-mx-sdhc-mmc.c index e92e63cb5641..b32364f20c32 100644 --- a/drivers/mmc/host/meson-mx-sdhc-mmc.c +++ b/drivers/mmc/host/meson-mx-sdhc-mmc.c @@ -388,7 +388,7 @@ static int meson_mx_sdhc_map_dma(struct mmc_host *mmc, struct mmc_request *mrq) dma_len = dma_map_sg(mmc_dev(mmc), data->sg, data->sg_len, mmc_get_dma_dir(data)); - if (dma_len <= 0) { + if (!dma_len) { dev_err(mmc_dev(mmc), "dma_map_sg failed\n"); return -ENOMEM; }