Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1097625rwo; Wed, 2 Aug 2023 08:40:38 -0700 (PDT) X-Google-Smtp-Source: APBJJlFwHnbiixryBo+Q3W8pYvgLZSPZT6OAWEnzaig5GwKT+sIr6ZzrZKApm916s+vBO00vyBRn X-Received: by 2002:a05:6402:517a:b0:522:582c:f427 with SMTP id d26-20020a056402517a00b00522582cf427mr8092649ede.14.1690990837913; Wed, 02 Aug 2023 08:40:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690990837; cv=none; d=google.com; s=arc-20160816; b=Fz1xWP2qdL5uX3WehF7GMqR9HKcq0EcSCny8hFzoygBr/0qtxNyBVS3ES3JE91aXu8 BuldfjvwMRxC8fhfjx2iOkrueN5i2eYZ4a84GyT0QA6su8Tg3KzSB/gIahBIJz2+QDKu cK9ptITIVcmqwEeQOfne5QLsAKeCLH9+3aS0P5UbvHog5J1c2Aj8bxf3q9IQEPahbxFb nmBktyi5jakJPllbYl3g6mm0UGV5HBc4iaQ2KF3+b61SzE7O86bivLmZGP6tPd9nz8im D4tWBWE+MnmLIhykPgOhqutSo41DJ9sZLgFkaiQwdkn3xA8R+swzM198fdAO/+4wbABY vT9w== 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:date :message-id:subject:references:in-reply-to:cc:to:from:dkim-signature; bh=EH/qoegRHnu+b8cDz/dAxuYea2UnuHQevVxVsME5zDE=; fh=L5tAJJQqCedCOirm7koT41PrglGMW6WRE0kT0nq8cKg=; b=OgrobTh8pfMklGqpsOyWYI2Klnqj218vAC9XsEkXsae33kx3mV4C05jan/kYYDDg2y PyQ631fTEtDZJQ46lCxST9rOUjD0RsYz3l2Vuz3jHpTPzyy+TjwzLGSxqw4rS5glaEBn GMWCxRfchM6Wh5LJzvSiThmjKcnGxN/Y6XlKFbuWLh3XlluGaQxi1MTE15Ex7chcsjyr 4NoGF4cZxdKtj2kzpj5j1TSZNLt+xWu1tJfm81lP08EuPH5Kkdsm01h1Cri+oP90Xpi5 SHqJpi5kuFPAfhEzf5rpOCkeypTdlZTAAhVNMGMKvA8QMRq92JxoC1MIhGItRWkebUYR Hxrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="cg/AqtTB"; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a9-20020aa7d749000000b0051e7235b2e8si10388245eds.542.2023.08.02.08.40.12; Wed, 02 Aug 2023 08:40:37 -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=@linaro.org header.s=google header.b="cg/AqtTB"; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234640AbjHBPAN (ORCPT + 99 others); Wed, 2 Aug 2023 11:00:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234469AbjHBPAK (ORCPT ); Wed, 2 Aug 2023 11:00:10 -0400 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F4482102 for ; Wed, 2 Aug 2023 08:00:09 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3fe110de3b6so7129115e9.1 for ; Wed, 02 Aug 2023 08:00:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690988407; x=1691593207; h=content-transfer-encoding:mime-version:date:message-id:subject :references:in-reply-to:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EH/qoegRHnu+b8cDz/dAxuYea2UnuHQevVxVsME5zDE=; b=cg/AqtTBjcSV1POS/R+K3T9D6D959LYVz9EDSHG0z8h31rpvPfkTxOlOfXME6wfPU0 fFEbcFmYLGE4y3tPWmE1O01eKQZdzy2afIc+j2F55AJGxvYTQibjq9tHDd4O1KnLkkPJ /huz0fhvd007cO8R/jnxmV1w8VDkzGyiE3nxVeJx7M8zsq36aTFqqUqF5Xkl/BJdQ+G9 a8ivIi/AAS+fuBqW3MGRWxBapI3zpXp+qy5uc1rpkt6rz3wqHqlN0kof+Bvj8qbUvJed u99T/YmlEp1XGtVczNAszJih7vjUNiEzFixV2YT1J68NVB8slxQl4eWrjE95SQDJBof1 ds6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690988407; x=1691593207; h=content-transfer-encoding:mime-version:date:message-id:subject :references:in-reply-to:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EH/qoegRHnu+b8cDz/dAxuYea2UnuHQevVxVsME5zDE=; b=h+nu9e7k47Shbe8/APRpSoCPjBntBq1wkv/+/b0Cd4GAyfAe19dyKtWQnC/+4w2AAk ujEXsdcwxtezLJohRT5ieguHankQYtZ7yse35CclWjIM/loZYZBhOwAPfvn278ekEzaI Zc577adJFdyNTgnAZtlfmJ9jrc9OXtqiFdMbJHLmxzhPkr11OMU5DSYz/e+Fk8dY08Yo KCNvs6P0GNd4n1vmCn7J91Yzvf8xdw75pu/U8SL1Go0cUJqSoq5wZM7P6ASIZZciIXtu VhkHTrbax0JGiRHkyqhL2vS+PkRv5Z/rCinvZVkZckRbvMOCjab9LMd9FoiBBdptPElE 8Slg== X-Gm-Message-State: ABy/qLZjLzk3NJAtzHagRA1099rkm9IIaERVYtb3gnrxEL7WbDfpixOE PgAxJ5yHS52M1usvauW7N4GzuLf4GbnzYdBEU0o= X-Received: by 2002:a05:600c:1d06:b0:3fe:3389:122f with SMTP id l6-20020a05600c1d0600b003fe3389122fmr1667528wms.1.1690988407271; Wed, 02 Aug 2023 08:00:07 -0700 (PDT) Received: from [192.168.1.195] ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id p16-20020a1c7410000000b003fe263dab33sm1904438wmc.9.2023.08.02.08.00.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Aug 2023 08:00:06 -0700 (PDT) From: Srinivas Kandagatla To: linux-arm-msm@vger.kernel.org, Ekansh Gupta Cc: ekangupt@qti.qualcomm.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, fastrpc.upstream@qti.qualcomm.com, stable In-Reply-To: <1690984656-11761-1-git-send-email-quic_ekangupt@quicinc.com> References: <1690984656-11761-1-git-send-email-quic_ekangupt@quicinc.com> Subject: Re: [PATCH v4] misc: fastrpc: Fix incorrect DMA mapping unmap request Message-Id: <169098840645.77008.10424849723734584416.b4-ty@linaro.org> Date: Wed, 02 Aug 2023 16:00:06 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Mailer: b4 0.12.2 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_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Wed, 02 Aug 2023 19:27:36 +0530, Ekansh Gupta wrote: > Scatterlist table is obtained during map create request and the same > table is used for DMA mapping unmap. In case there is any failure > while getting the sg_table, ERR_PTR is returned instead of sg_table. > > When the map is getting freed, there is only a non-NULL check of > sg_table which will also be true in case failure was returned instead > of sg_table. This would result in improper unmap request. Add proper > check before setting map table to avoid bad unmap request. > > [...] Applied, thanks! [1/1] misc: fastrpc: Fix incorrect DMA mapping unmap request commit: 3042d44f7e49c74f2928b4780c66564632449bab Best regards, -- Srinivas Kandagatla