Received: by 10.192.165.148 with SMTP id m20csp3229500imm; Mon, 23 Apr 2018 02:59:41 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/OkuUWr+457bomZaLEOuGuygnxVYHyZer9r37vCKkYTiGoKsS6OwLpehc/Ohy+LBNuEENX X-Received: by 10.98.204.220 with SMTP id j89mr19272787pfk.182.1524477580965; Mon, 23 Apr 2018 02:59:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524477580; cv=none; d=google.com; s=arc-20160816; b=sXaxxOM2yfimj5wt9yFXdwY5DbbK6fyktWVmWZYKm5SLLBOvuLHZ8sJgnSnwVJ9BUO PG1/DuaML/YxLCgud5gZMuaoQVrXEHvq7OhlKbAkvD+Y20Gb/AdJLVEqd7SVI3rOHx78 TxIC9Q5opTa/uereDNP8CBaX2LWarFnPSP9dJUUK/o7TyXKISHuXIfVGN2CAUvYY9V0M JUlZH2cB+AgRlu72xVAjK24KRn/bJle9zQ44t5PhvBXaTOvU6Gc+/tCpT8nqHMDS8VHZ gPjuRB3Q3ymj3Zc+E7ZaJ4lXZcMbHYZxv4hJJiw7tjfms7Cr4dcufc2AXOo2QuJrHuXE Grkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:dkim-signature:arc-authentication-results; bh=gCH438B0ataaTYuknX0X2AHWcEIMnCRh1lXZv8S8xQg=; b=QixEAGomLDPb/rlrb80oyYOkJIHetByWvW785G2u2fWuzSUvo96+fJXimtFd7kQQpV Lk3ZjHYuUnCbEBiIi/0FTbOQ/0ZFxIeWfv1t/FsKQtE18nUAAOIruX/7kDpz8kvVaqws jTpbI23rKi8TBFLOdqI7Pc0KEMHo4Akd5VQhbjiJLrrUQe/fKvcNW1pBOgxB/b+Nr4x3 6v/nNj59rA78tHcisUlPQCNqEVyWKVVV+rILld96/oxN2DP25LTmR/wMXcoVLXO51hNu LLVjPFi72RhlKRHgy48Y0IkoA9AZy3vZOa6T8YBjAx4CxWmqCDHOw9tjuIVKh01pFM8U 9isg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kapsi.fi header.s=20161220 header.b=az5TroMe; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 61-v6si7240426plz.290.2018.04.23.02.59.26; Mon, 23 Apr 2018 02:59:40 -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=@kapsi.fi header.s=20161220 header.b=az5TroMe; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754623AbeDWJ6N (ORCPT + 99 others); Mon, 23 Apr 2018 05:58:13 -0400 Received: from mail.kapsi.fi ([91.232.154.25]:36121 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754130AbeDWJ6K (ORCPT ); Mon, 23 Apr 2018 05:58:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kapsi.fi; s=20161220; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:Cc:References:To:Subject; bh=gCH438B0ataaTYuknX0X2AHWcEIMnCRh1lXZv8S8xQg=; b=az5TroMeJG2zrFKF4W5NVsKDORMpcF7Z800DY/0VGIRQJRcCeFEkYAulkGNn7OQiNSB6k6VxAz1MApakNfmtfh3cLdlRZK+McRLIUJq5RAn1NbQDYs2yBlmjvpdAghsO6fKnFdOhSC8mSqCO3rVINBoMSnLYtJ2o9mkMgQCxE6sVMVdOIVlZB4w+6Md77RZxv5f+rzsvDqUKsWqQeJ3CZ4ob1eiN9JtWIFC1iBmeD32Y0A/rPYryICIFf25CUR+2HiEw2Y4Ay+VfAHTRo0tDWI7s85YLCH4977JTgdpI8M14fQqt/1jnHrM3INDdyv1Ymi1ihLfqypSQWEP719ebNA==; Received: from [62.209.167.43] (helo=[10.21.26.144]) by mail.kapsi.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1fAYEa-0006jF-7J; Mon, 23 Apr 2018 12:58:08 +0300 Subject: Re: [PATCH v1] gpu: host1x: Fix dma_free_wc() argument in the error path To: Dmitry Osipenko , Thierry Reding References: <20180423095456.16697-1-digetx@gmail.com> Cc: Mikko Perttunen , dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org From: Mikko Perttunen Message-ID: <9bfd3550-b712-f838-cb96-5ca1255825d4@kapsi.fi> Date: Mon, 23 Apr 2018 12:58:04 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20180423095456.16697-1-digetx@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 62.209.167.43 X-SA-Exim-Mail-From: cyndis@kapsi.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reviewed-by: Mikko Perttunen On 23.04.2018 12:54, Dmitry Osipenko wrote: > 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; > } >