Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3950139pxb; Tue, 2 Mar 2021 02:49:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJw7SVDVmYbSwptk+7/tqxflFfvJ0G0GS6QaRmlmv7CJFvaFSVGOY40w5MtDBkxGvSHcfmko X-Received: by 2002:a05:6402:57:: with SMTP id f23mr20048751edu.319.1614682189688; Tue, 02 Mar 2021 02:49:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614682189; cv=none; d=google.com; s=arc-20160816; b=N13uxOa5sOpKn5eyxyb+vF7H4b6MR1xEpNy7VVdVFp1ExIi1xco9ekRVUqvwerTyx8 Bt7uGdPJXccOqlp+DsaJ2oKjyHC6OvotnVeYtdXyrQD+IqAD64hfDBJBzGybsss7nSBb RUY/1HBiweagnTr01VhZr2Hu/TO5D8KYkJi8PaWnls21gIVZlC8gkTK1t4XCXA+wVRG1 Znr/AlP1ZNQNX6gMi/6YGorfB5t2cOTrGpeZjNav+4jgkYlaH8bH0OUVQtvFAFrZBSXU wbeekyvJdXxyFuqZKWrymCDMWkyowvZc+Ha19prTPkE/Su7Cm3gxkNdu+5EsuDhOhEFQ sclQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7qlsOfho2tHrqGg0jfTON0h6cQFhpvuRzaw0x7+2CAg=; b=TZVbRG8LGPsD8ocdlNx104MEXjO0NQFyQpnWB2iX9wkgroAU/4sKv9tKMwqdG2LtAH GH3mNvA7xihASJqoDqUwfq8HBbDakai6qa9cAEhu5Rr6ZdkclvXci5+yD81PWCOgGNt/ a31cTsEKAUsCoTcqJysCujkFXuXevsHtOcKjOVFmYdwgXkZanyi2Rh2Ajdl5DhB4P0UH YjrJNieyV6GEIN5oGpJxR1WeNlBk0Sz6sCI8K8w2lEeyaQmcnLETg0YooLDcojR1XrXD rFwzcCpD+Euzs9X5lKkK8otXW2XbVKm95lW9myInSlgU4CCM9jkj5KIgmQFyFMwOZ/oo 1T6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Q353ORHj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z19si13271700edr.437.2021.03.02.02.49.27; Tue, 02 Mar 2021 02:49:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Q353ORHj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348988AbhCBBrs (ORCPT + 99 others); Mon, 1 Mar 2021 20:47:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:47282 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237255AbhCATYe (ORCPT ); Mon, 1 Mar 2021 14:24:34 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B280965221; Mon, 1 Mar 2021 17:23:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614619436; bh=acG8srrmjBQL3sAMaa1q5QeVIPk67vTYRqvTEiuXr1c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q353ORHjPi/56HEf6WJs+mJMPE/8NSiJqed6dPgn71aYcf8YqiKIhJFhS/mwpMf40 ov7zmIH44OvL55ZR+z7YWgWEq8+vnZDJOivOaxDuR9/TyiqdFj4IFsFBi7F15TuwXK E1L2qbOiAOEQ5CXkn5F/JElFmlU2ZMEvc7mT0Nso= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marek Szyprowski , Jonathan Marek , Sasha Levin Subject: [PATCH 5.10 426/663] misc: fastrpc: fix incorrect usage of dma_map_sgtable Date: Mon, 1 Mar 2021 17:11:14 +0100 Message-Id: <20210301161202.959571315@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161141.760350206@linuxfoundation.org> References: <20210301161141.760350206@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jonathan Marek [ Upstream commit b212658aebda82f92967bcbd4c7380d607c3d803 ] dma_map_sgtable() returns 0 on success, which is the opposite of what this code was doing. Fixes: 7cd7edb89437 ("misc: fastrpc: fix common struct sg_table related issues") Acked-by: Marek Szyprowski Signed-off-by: Jonathan Marek Link: https://lore.kernel.org/r/20210208200401.31100-1-jonathan@marek.ca Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/misc/fastrpc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 994ab67bc2dce..815d01f785dff 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -520,12 +520,13 @@ fastrpc_map_dma_buf(struct dma_buf_attachment *attachment, { struct fastrpc_dma_buf_attachment *a = attachment->priv; struct sg_table *table; + int ret; table = &a->sgt; - if (!dma_map_sgtable(attachment->dev, table, dir, 0)) - return ERR_PTR(-ENOMEM); - + ret = dma_map_sgtable(attachment->dev, table, dir, 0); + if (ret) + table = ERR_PTR(ret); return table; } -- 2.27.0