From patchwork Fri Dec 13 22:23:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 22389 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 30A5923FBA for ; Fri, 13 Dec 2013 22:26:44 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id ii20sf2640236qab.0 for ; Fri, 13 Dec 2013 14:26:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=WJOYnrJEMcBtybzfifHuB0r9Qro992KcbSZxSvgYA70=; b=THZLTmwNEv1r0rYrZ5va4WRxvIfM4JWRNWtjKlmrYMZdu00knKfjbRxkMKVHG115hU T9d+oYGAucLBhqnj6nwWDShXQCvtF2C34ieImMsiZmyUir598Fb/TQro5Dl+GQejEQwq MNOkE6jwfRpwU5MQp8tF+tVsycyn/7iLVTdPa0pB1yv/Cd1XHtHDxtptCTUjMedaUz81 cbb2L42RcnYOy+VZ34YEBH5XwwmmP27lrfAsCL+YipHr7bvbfTsw25SVmNUry/wuvp8w utyleIS2MP1UR8apNk38VBKq3ygmw8PEVLgjeD5N0dGW7CYvAtTk4NuAyYn+5UjfjNQ0 bK/Q== X-Gm-Message-State: ALoCoQneh6tnwU9tcoNvns9eGbc/IImQQyrlvtWQZ+5gqt5o2WwOXCpbEJhzsTlNQ/gWrC7crt/2 X-Received: by 10.58.213.133 with SMTP id ns5mr1736770vec.30.1386973604026; Fri, 13 Dec 2013 14:26:44 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.86.232 with SMTP id s8ls1175231qez.67.gmail; Fri, 13 Dec 2013 14:26:43 -0800 (PST) X-Received: by 10.221.3.200 with SMTP id nz8mr1097890vcb.67.1386973603854; Fri, 13 Dec 2013 14:26:43 -0800 (PST) Received: from mail-ve0-f178.google.com (mail-ve0-f178.google.com [209.85.128.178]) by mx.google.com with ESMTPS id sl9si1194968vdc.60.2013.12.13.14.26.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:26:43 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.178; Received: by mail-ve0-f178.google.com with SMTP id c14so1834774vea.37 for ; Fri, 13 Dec 2013 14:26:43 -0800 (PST) X-Received: by 10.52.121.113 with SMTP id lj17mr57159vdb.85.1386973603778; Fri, 13 Dec 2013 14:26:43 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp73488vcz; Fri, 13 Dec 2013 14:26:43 -0800 (PST) X-Received: by 10.68.29.4 with SMTP id f4mr5960527pbh.85.1386973603069; Fri, 13 Dec 2013 14:26:43 -0800 (PST) Received: from mail-pb0-f47.google.com (mail-pb0-f47.google.com [209.85.160.47]) by mx.google.com with ESMTPS id j8si918000pad.33.2013.12.13.14.26.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:26:43 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.47 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.160.47; Received: by mail-pb0-f47.google.com with SMTP id um1so3127237pbc.6 for ; Fri, 13 Dec 2013 14:26:42 -0800 (PST) X-Received: by 10.66.121.164 with SMTP id ll4mr6202031pab.48.1386973602685; Fri, 13 Dec 2013 14:26:42 -0800 (PST) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id qz9sm7457908pbc.3.2013.12.13.14.26.41 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:26:41 -0800 (PST) From: John Stultz To: LKML Cc: Greg KH , Android Kernel Team , Sumit Semwal , Jesse Barker , Colin Cross , Rebecca Schultz Zavin , John Stultz Subject: [PATCH 024/115] gpu: ion: Only map as much of the vma as the user requested Date: Fri, 13 Dec 2013 14:23:58 -0800 Message-Id: <1386973529-4884-25-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1386973529-4884-1-git-send-email-john.stultz@linaro.org> References: <1386973529-4884-1-git-send-email-john.stultz@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Rebecca Schultz Zavin Signed-off-by: Rebecca Schultz Zavin [jstultz: modified patch to apply to staging directory] Signed-off-by: John Stultz --- drivers/staging/android/ion/ion_system_heap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c index 3f607df..7397bc4 100644 --- a/drivers/staging/android/ion/ion_system_heap.c +++ b/drivers/staging/android/ion/ion_system_heap.c @@ -192,6 +192,8 @@ int ion_system_heap_map_user(struct ion_heap *heap, struct ion_buffer *buffer, remap_pfn_range(vma, addr, page_to_pfn(sg_page(sg)), sg_dma_len(sg), vma->vm_page_prot); addr += sg_dma_len(sg); + if (addr >= vma->vm_end) + return 0; } return 0; }