From patchwork Tue Dec 11 08:51:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Mossberg X-Patchwork-Id: 13467 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id C226D2425B for ; Tue, 11 Dec 2012 08:52:47 +0000 (UTC) Received: from mail-ia0-f169.google.com (mail-ia0-f169.google.com [209.85.210.169]) by fiordland.canonical.com (Postfix) with ESMTP id 2ACD8A19342 for ; Tue, 11 Dec 2012 08:52:47 +0000 (UTC) Received: by mail-ia0-f169.google.com with SMTP id r4so7385747iaj.0 for ; Tue, 11 Dec 2012 00:52:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to :date:message-id:x-mailer:mime-version:subject:x-beenthere :x-mailman-version:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:content-type :content-transfer-encoding:sender:errors-to:x-gm-message-state; bh=aNNLpZdFCpHvzU6Wi2Aw2KDishoXMIfx9wX98XzS0YI=; b=DZ05gxFp4qCwvyDETxG/aLivtug6zsfdP9sAhQMUzaygJTHM0ccRmz5tg1KEBY2rz4 /zFlhkMTm4AWs0d3AazxuHg70TQ+Hg6gpbX3d1bkKGXN0AgVOMFneBvONWcekgdKRQcv tYTW/lyQQxsR+0cuG4yI+NopWWMv1iaottrDSudA+HkN+XcErDkkUNTAaZ9v5w5xqetq xCxN/SzTti3+zpAT//SRxn/TLVodt557w/TXxKf0A62cmUUyvRYHjWbQnI0WokvKZbNH vJ8QcFgToPI0RS3LVn0WgOlzpf8g1nndITD5h2HeNEwgKb8YkF1V6uOF5TVErtIZTTbi 3r8w== Received: by 10.50.187.197 with SMTP id fu5mr9098326igc.70.1355215966473; Tue, 11 Dec 2012 00:52:46 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp118448igt; Tue, 11 Dec 2012 00:52:45 -0800 (PST) Received: by 10.14.177.1 with SMTP id c1mr58524910eem.8.1355215965033; Tue, 11 Dec 2012 00:52:45 -0800 (PST) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id j49si53211131eep.21.2012.12.11.00.52.42; Tue, 11 Dec 2012 00:52:45 -0800 (PST) Received-SPF: neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) client-ip=91.189.95.16; Authentication-Results: mx.google.com; spf=neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) smtp.mail=linaro-mm-sig-bounces@lists.linaro.org Received: from localhost ([127.0.0.1] helo=mombin.canonical.com) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TiLZv-0005rd-0Y; Tue, 11 Dec 2012 08:52:39 +0000 Received: from eu1sys200aog113.obsmtp.com ([207.126.144.135]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TiLZs-0005rG-G4 for linaro-mm-sig@lists.linaro.org; Tue, 11 Dec 2012 08:52:36 +0000 Received: from beta.dmz-us.st.com ([167.4.1.35]) (using TLSv1) by eu1sys200aob113.postini.com ([207.126.147.11]) with SMTP ID DSNKUMb0Ux0R6EDLoClHi0H4z2uId/HqIDjq@postini.com; Tue, 11 Dec 2012 08:52:36 UTC Received: from zeta.dmz-us.st.com (ns4.st.com [167.4.16.71]) by beta.dmz-us.st.com (STMicroelectronics) with ESMTP id 31A813B for ; Tue, 11 Dec 2012 08:51:55 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id BB7BD59 for ; Tue, 11 Dec 2012 03:43:26 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 1009657C31F for ; Tue, 11 Dec 2012 09:52:29 +0100 (CET) Received: from steludxu2915.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server id 8.3.83.0; Tue, 11 Dec 2012 09:52:32 +0100 From: Johan Mossberg To: Date: Tue, 11 Dec 2012 09:51:52 +0100 Message-ID: <1355215912-28715-1-git-send-email-johan.mossberg@stericsson.com> X-Mailer: git-send-email 1.8.0 MIME-Version: 1.0 Subject: [Linaro-mm-sig] [PATCH] gpu: ion: Fix incorrect usage of heap id in ion_alloc X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Unified memory management interest group." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQmRUH3JrWBb3A8Vi317Pjet9PrFoXl3y4kxD6IUUPqYIiZsmPrJX7Muq8h/A+o4j5IJmmfq The heap id is compared against the heap mask in ion_alloc which is incorrect, the heap type should be used. Signed-off-by: Johan Mossberg --- drivers/gpu/ion/ion.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/ion/ion.c b/drivers/gpu/ion/ion.c index fc152b9..c811380f 100644 --- a/drivers/gpu/ion/ion.c +++ b/drivers/gpu/ion/ion.c @@ -414,7 +414,7 @@ struct ion_handle *ion_alloc(struct ion_client *client, size_t len, if (!((1 << heap->type) & client->heap_mask)) continue; /* if the caller didn't specify this heap type */ - if (!((1 << heap->id) & heap_mask)) + if (!((1 << heap->type) & heap_mask)) continue; buffer = ion_buffer_create(heap, dev, len, align, flags); if (!IS_ERR_OR_NULL(buffer))