From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754698AbbKQT2e (ORCPT ); Tue, 17 Nov 2015 14:28:34 -0500 Received: from mail-pa0-f53.google.com ([209.85.220.53]:34070 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754521AbbKQT2c (ORCPT ); Tue, 17 Nov 2015 14:28:32 -0500 From: Joshua Clayton To: linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org Cc: Anton Bondarenko , Mark Brown , linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org Subject: Re: [PATCH 3/8] Documentation/spi/spidev_test.c: accept input from a file Date: Tue, 17 Nov 2015 11:28:29 -0800 Message-ID: <5345438.ORMdKP6N7u@jclayton-pc> User-Agent: KMail/5.0.2 (Linux/4.2.0-18-generic; KDE/5.15.0; x86_64; ; ) In-Reply-To: <564B716E.5020605@gmail.com> References: <564B716E.5020605@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday, November 17, 2015 07:26:54 PM Anton Bondarenko wrote: > On 17.11.2015 16:24, Joshua Clayton wrote: > > + if (sb.st_size > 4096) > > + pabort("input file exceeds spidev's 4k limit"); > This is not a true. IIRC PAGE_SIZE is the default buffer size for > spidev, but can be changed using bufsiz module parameter. > Just 'insmod spidev bufsiz=X', where X is number of bytes. You are right. I will drop this. As Mark suggests. The ioctl gives a nice error code if the buffer is too big. ... > > + tx = malloc(sb.st_size); > It would be good to check new allocations for fail. I will add a check for this. -- ~Joshua Clayton