From patchwork Sat Dec 14 03:26:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 22470 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f198.google.com (mail-ve0-f198.google.com [209.85.128.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2631823FF5 for ; Sat, 14 Dec 2013 03:26:58 +0000 (UTC) Received: by mail-ve0-f198.google.com with SMTP id oy12sf5234158veb.5 for ; Fri, 13 Dec 2013 19:26:58 -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=EgsexkU8N68Vio7YULuHk07JpUe8xkehtmuZxy79vX0=; b=jNrn9con5+9I23Gm2smGtPWZy3oiOOuhysIaN6R9gFmb8/fPiyN3t8kjO3mI6r9eLG qFRHsSPzLjF2uYHBdGso0cYV7wM+/++APjv8Jsrv9E/7vOcsAfv6rzWzZ19v0iUcScBB oUSgXcjkOpX3MlNIHCfELuuM3YdT1V1ILPTZfOD60B1qTsaoZnhrmNqO7KUqLK6kkMnN GlE4B0uK+YkRG161bgMgWLOaiugWMYfy2hECzrRvHFdgYabPbyB3898VqZ19npIfOnF6 xWGG0vuCVDK2qTB+zO3tZI8pcm57rBnhKWsJ8fEbqjG13F2dZC2/GNjkPIJhR9L5C3T5 wmPw== X-Gm-Message-State: ALoCoQlpAw2Y8c9tTA7DAB/zd4NRxIyrGzWio+Y87InMFmpe4y0nlgRt91XjK2UmK2vuB9sKAfTH X-Received: by 10.52.76.34 with SMTP id h2mr1905290vdw.2.1386991617964; Fri, 13 Dec 2013 19:26:57 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.83.2 with SMTP id m2ls1323422qey.37.gmail; Fri, 13 Dec 2013 19:26:57 -0800 (PST) X-Received: by 10.58.154.6 with SMTP id vk6mr4475veb.61.1386991617804; Fri, 13 Dec 2013 19:26:57 -0800 (PST) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id om4si1418577vcb.143.2013.12.13.19.26.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 19:26:57 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.173 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.173; Received: by mail-ve0-f173.google.com with SMTP id oz11so1956690veb.18 for ; Fri, 13 Dec 2013 19:26:57 -0800 (PST) X-Received: by 10.58.11.73 with SMTP id o9mr2613109veb.8.1386991617702; Fri, 13 Dec 2013 19:26:57 -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 u4csp86942vcz; Fri, 13 Dec 2013 19:26:57 -0800 (PST) X-Received: by 10.68.209.193 with SMTP id mo1mr7403391pbc.38.1386991617004; Fri, 13 Dec 2013 19:26:57 -0800 (PST) Received: from mail-pb0-f43.google.com (mail-pb0-f43.google.com [209.85.160.43]) by mx.google.com with ESMTPS id im7si2960826pbd.281.2013.12.13.19.26.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 19:26:57 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.43 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.160.43; Received: by mail-pb0-f43.google.com with SMTP id rq2so3315953pbb.16 for ; Fri, 13 Dec 2013 19:26:56 -0800 (PST) X-Received: by 10.66.162.136 with SMTP id ya8mr7102413pab.110.1386991616638; Fri, 13 Dec 2013 19:26:56 -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 nw11sm11680086pab.13.2013.12.13.19.26.55 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 19:26:56 -0800 (PST) From: John Stultz To: LKML Cc: Greg KH , Android Kernel Team , Sumit Semwal , Jesse Barker , Colin Cross , John Stultz Subject: [PATCH 100/115] ion: add alignment check to carveout heap Date: Fri, 13 Dec 2013 19:26:20 -0800 Message-Id: <1386991595-6251-8-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1386991595-6251-1-git-send-email-john.stultz@linaro.org> References: <1386973529-4884-1-git-send-email-john.stultz@linaro.org> <1386991595-6251-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.173 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: Colin Cross Signed-off-by: Colin Cross Signed-off-by: John Stultz --- drivers/staging/android/ion/ion_carveout_heap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/android/ion/ion_carveout_heap.c b/drivers/staging/android/ion/ion_carveout_heap.c index 1d53e91..b0b08c3 100644 --- a/drivers/staging/android/ion/ion_carveout_heap.c +++ b/drivers/staging/android/ion/ion_carveout_heap.c @@ -70,6 +70,9 @@ static int ion_carveout_heap_allocate(struct ion_heap *heap, unsigned long size, unsigned long align, unsigned long flags) { + if (align > PAGE_SIZE) + return -EINVAL; + buffer->priv_phys = ion_carveout_allocate(heap, size, align); return buffer->priv_phys == ION_CARVEOUT_ALLOCATE_FAIL ? -ENOMEM : 0; }