Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1239765rwb; Thu, 18 Aug 2022 23:12:39 -0700 (PDT) X-Google-Smtp-Source: AA6agR7eUKfyxJLO/uKmFM5M3he8TBhJx0EZWLHZZKUDNMpL9SbQT8iumGNHQ4U3dSGwdPlBZfzH X-Received: by 2002:a17:902:ef46:b0:168:bac3:2fd4 with SMTP id e6-20020a170902ef4600b00168bac32fd4mr5856582plx.132.1660889559431; Thu, 18 Aug 2022 23:12:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660889559; cv=none; d=google.com; s=arc-20160816; b=mMJla5kWskQkpswNyet44NdSsfjbDH2QOYtpLAyxIJyqBOt+d1wXe45TGqsulHEuJ3 xmRizPoyJ9kxO+qzOLx4t7fChe4kPeLr1hC42cHcDyh6N4wHv55YuDtYTuQUZf4bsCHi cZpsp/zEAuwd59fmk82URnAHMitTd7KkLYEcgKCVu35KoBr0H0y9y1qTEPbu1ZJVnfxu xw8iFnowstKkQgaxr2qjhm7AisFLKfaf/Zr59X78wX7VXy1p7V+A/PFpGLGDzy6i0JDw LSk/Q1VtvLTBMysb5O7NfHdaoELYQkxfuyUl+mBpAsxUfsKBLG41//Oo4P4IgVaQDtdS Vw7A== 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=aWxibmll6dw/pqOCoi7TR4UJQijH/2FtimkTNrGyezk=; b=OqRHqby8shgBJMtNqSs0Zpk8MQKrr5fvrHk/s+T0Re+U+0P7Q0x3o3fu7uLXeOIOib OQrxBCa5+OsD7pKE8MVi8BXGG6ZCUtmIRWPy/s6zVuVtO3WGCvIJ4GE0o+CXAM99yxu3 dn1hFjnxdwDz0nnMCs4zoN8R6OPRKE0p40QcOQ9FxQt9TUcMB7T/KnTx43IEYXFloV3l zRFizlgIbU1nbPkbR7bW75WZxM+r7P48lppU7DDVlfKBIkOeljzu9T4QfkKHa6cJv0oR qCtmVMStLT0DxTpzad4FpkMzxnYou6HTuAZH1OfXooNkqxqAMv40dWna7jXbnh61B5h+ dKXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=BvBSOSyw; 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=NONE sp=NONE dis=NONE) header.from=ionos.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k17-20020a056a00135100b0053549ef1b46si3540485pfu.331.2022.08.18.23.12.27; Thu, 18 Aug 2022 23:12:39 -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=@ionos.com header.s=google header.b=BvBSOSyw; 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=NONE sp=NONE dis=NONE) header.from=ionos.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346645AbiHSGJ5 (ORCPT + 99 others); Fri, 19 Aug 2022 02:09:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346640AbiHSGJD (ORCPT ); Fri, 19 Aug 2022 02:09:03 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C1B03E775 for ; Thu, 18 Aug 2022 23:08:33 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id j21so1601262ejs.0 for ; Thu, 18 Aug 2022 23:08:33 -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=aWxibmll6dw/pqOCoi7TR4UJQijH/2FtimkTNrGyezk=; b=BvBSOSyw3iiv7zGvCap/WbdDf/oN0NTZE0qS3IMD0KNzeUdTvihvlvLMuuYitRZvE/ m91mX5BcHAzQzmFlYJ9XOMgeaKGEidyXAmrwZyN9tu4ux2wrV78lw/hrcbiXneJuZZEs cFVDStud4vcr2LzM4HQ3TqvwE4yXd75WYW32FPgqBEgFhe+MbOcln3OEbaJdLxL3OpmG yz4pjFzomcWQWZrGSR928lMeJDqYKk7nzXFR1WwiTdcleoICgdZczEbk4dE3ByCZ3W52 ZPE7HrzuhjQWRDJh6F1NgSQal4hinjGHUmETkoVL7jQYlECrig3h4g0k89jbgWMEWaBH njDQ== 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=aWxibmll6dw/pqOCoi7TR4UJQijH/2FtimkTNrGyezk=; b=kgALqT1AkS0wpRzwtgM4VlmJ9iZypfnjZvPvpuQ+mzeXmLvUfPTaIndY7uC3fYbPEn b6I7B0B1guEGUjcybQWRG4TfULaKYrx/nwpQHOjDYpBSmnO1rx+RUJ2euPUgBefiuXIe k/BDTQtev30b7tx5UWPdc6gr5gjj2AnBKjwT5x/p8SKANBEdIEaApRZ4WNYycYfzPZZ6 Wzly3fHqakNGh1ojV99ghVQyRJNz3JUh/POljeKNKHzNKLSYH4quVyM68i2YvL3pGYXa XeDTov9WnOSmYfTmIhhxiSCjle+n8IG6cZkOafggoJZy6QL1eDqRtzKe3esqO8XJjJVo 1oew== X-Gm-Message-State: ACgBeo3DeET0Xwhip6YGu+vWYiG6j/c/FRZij+RJWl64KvKD9p6Lti8K lT6wFZfoqrIQTbiIF2K9OEJ/cB9uaEWZutds X-Received: by 2002:a17:907:1c26:b0:730:960f:118 with SMTP id nc38-20020a1709071c2600b00730960f0118mr3868462ejc.650.1660889311411; Thu, 18 Aug 2022 23:08:31 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 23:08:30 -0700 (PDT) From: Jack Wang To: linux-kernel@vger.kernel.org Cc: Paul Cercueil , Ulf Hansson , linux-mips@vger.kernel.org, linux-mmc@vger.kernel.org Subject: [PATCH v1 18/19] mmc: jz4740_mmc: Fix error check for dma_map_sg Date: Fri, 19 Aug 2022 08:08:00 +0200 Message-Id: <20220819060801.10443-19-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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 dma_map_sg return 0 on error. Cc: Paul Cercueil Cc: Ulf Hansson Cc: linux-mips@vger.kernel.org Cc: linux-mmc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Jack Wang --- drivers/mmc/host/jz4740_mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/jz4740_mmc.c b/drivers/mmc/host/jz4740_mmc.c index b1d563b2ed1b..666600055b06 100644 --- a/drivers/mmc/host/jz4740_mmc.c +++ b/drivers/mmc/host/jz4740_mmc.c @@ -308,7 +308,7 @@ static int jz4740_mmc_prepare_dma_data(struct jz4740_mmc_host *host, data->sg_len, dir); - if (sg_count <= 0) { + if (!sg_count) { dev_err(mmc_dev(host->mmc), "Failed to map scatterlist for DMA operation\n"); return -EINVAL; -- 2.34.1