Received: by 10.192.165.148 with SMTP id m20csp3228202imm; Mon, 23 Apr 2018 02:57:43 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+DmYhAsuF38ODhqbMJVT3HQuu0YulddYKUZ5uhDkQtMEBRc6RCgySW/DmD8wN7pLUX5M/F X-Received: by 2002:a17:902:784c:: with SMTP id e12-v6mr20303137pln.60.1524477463112; Mon, 23 Apr 2018 02:57:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524477463; cv=none; d=google.com; s=arc-20160816; b=j176poEVo+k2kiklx8TJPVuGJezL32L864yDvstP6RfjcKzeuplSJlJJkw7FmBh7dy HOYCEExf1VvisxHi1C8XGEtCVKC6Kq0Rn2gni/vPhDg9DZh1GoFGb0VC+D7Kli8UCvQA VkOvN7pGhPn25FPz5Z7VXsGcMXSW/cP9/ANeUw131kDg6CsSHjkV0zgxG6v959a8u0nc 3DfueipM8BdUjoV80/ixVqQgQivpZTAMrQizethdsAWzulNtcWOw9167iJePvRqPbPDP wf5XtgnmKOqUPY+l2w0zrP8d+J55U2gb+O2sK7+4HWkIUrYh3p3x1Axb6rBcs4eERyzz HTZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=89t6yfovgfVEKttzGSNTeT8XYJpZfZ/gWoAZJgCZWRo=; b=TNUfMTkvVqOyI6LP786U/yYdiKh4ojreeWwWVFsM7D8mms8fhSdrwlRE4NtfiLMWPc 8DuvKJH9m8LHXTrFUmp/VjgLpBZ4oACYlUPy+WumOS85vSm1Q6BaRNwUrRJBbRWEcxbA osjAXg6Vc7IfaqlWOQypttZisK1/vAgXOED074Eo2IBkJ5Bc9D5PNxoGcE+eXR7+oQQf VG0xIGDFR210wb1EwXRLOuUThoyx27ApgOo2eMfGBLS5VUjlM2QO1ngRUdqvFFRF5kPf 3c61pZB0OQmkRNx07xqCUsZv1jRJagauhLDt34kTuquSl0rihj3r/j1fU1JJWl53gWtO njxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uymp8BfK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p10si8967011pgr.52.2018.04.23.02.57.29; Mon, 23 Apr 2018 02:57:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uymp8BfK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754698AbeDWJzN (ORCPT + 99 others); Mon, 23 Apr 2018 05:55:13 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:35767 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754431AbeDWJzL (ORCPT ); Mon, 23 Apr 2018 05:55:11 -0400 Received: by mail-pg0-f65.google.com with SMTP id j11so8053673pgf.2; Mon, 23 Apr 2018 02:55:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=89t6yfovgfVEKttzGSNTeT8XYJpZfZ/gWoAZJgCZWRo=; b=uymp8BfK92vjtsMQq3FaiESgrmNSrRS6OBjuaGwWtDoGgMAAI+C31bog4w3wlJW9Sp J+ZNCpAMZpwOHDMnb/+mBAmkytzjrYh0q6onzoX9P7+j/lt8mQsX0WJw/+qXvYfsfc5y n9JmtEG3B0fEjG1dmhgvMJwu2I6TBheVTkUa/uXj+xb21QlZrZBCvie5hCQwnJ1XA+Yb Y3nt4b7YNAMBkcbrDiUPytk5W+dVMIs1CgHtvgbVD68KhBzu07xnmYUQWGU8SmqOSrYj qe4ihxHy4ohPltW4t8PXOGWh1G/vv3OAJmotBveqgyv8CoBKsBzi3+kNC3fZzb4OYUT4 RlmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=89t6yfovgfVEKttzGSNTeT8XYJpZfZ/gWoAZJgCZWRo=; b=a/kCV7QMUPtwf9VLXIMOk5Y/Xhz7wO97XLhxcXJB+CEM09YiIApPb5CjpC4tl2DITM 5kgNv16kvyj7Ww58VYi+KMgspVzrkwmlobqG4sw3qYmKt1H9cKNNwGa84dlkT0cxIaZa YAWekjtALL1WgAbMhh5/R203MQlyO3mF4Ll0WjkPbhM/NWCrlhhoONm/AykWY4PIymqV 0tOVRvNsYy7Y4ch3I+M1NyormVSi4HeihLJD3OKApBbB7We1roUPFKZZr+TACZMCcdHN iPA/XCRMttoBi09Lm/GDKFM/u7fP5un4tyWP8kPtk976KFmYSIiAL1nk/emsSo19aBD4 e5JA== X-Gm-Message-State: ALQs6tDvOkwM4L0Uj9433HOiFTPGhUn5zJSWaaGVlhEuAWqT5J/Q3ckL ybN3wUK/mtBk8XIa8sgTQ8s= X-Received: by 10.99.60.71 with SMTP id i7mr7165123pgn.254.1524477311185; Mon, 23 Apr 2018 02:55:11 -0700 (PDT) Received: from localhost.localdomain (ppp109-252-91-130.pppoe.spdop.ru. [109.252.91.130]) by smtp.gmail.com with ESMTPSA id u27sm23478852pfk.100.2018.04.23.02.55.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Apr 2018 02:55:10 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding Cc: Mikko Perttunen , dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1] gpu: host1x: Fix dma_free_wc() argument in the error path Date: Mon, 23 Apr 2018 12:54:56 +0300 Message-Id: <20180423095456.16697-1-digetx@gmail.com> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If IOVA allocation or IOMMU mapping fails, dma_free_wc() is invoked with size=0 because of a typo, that triggers "kernel BUG at mm/vmalloc.c:124!". Signed-off-by: Dmitry Osipenko --- drivers/gpu/host1x/cdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/host1x/cdma.c b/drivers/gpu/host1x/cdma.c index 93df28228721..0724122afeac 100644 --- a/drivers/gpu/host1x/cdma.c +++ b/drivers/gpu/host1x/cdma.c @@ -127,7 +127,7 @@ static int host1x_pushbuffer_init(struct push_buffer *pb) iommu_free_iova: __free_iova(&host1x->iova, alloc); iommu_free_mem: - dma_free_wc(host1x->dev, pb->alloc_size, pb->mapped, pb->phys); + dma_free_wc(host1x->dev, size, pb->mapped, pb->phys); return err; } -- 2.17.0