diff options
author | Daniel Hillenbrand <codeworkx@cyanogenmod.org> | 2013-06-18 08:25:05 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2013-06-18 08:25:05 -0700 |
commit | a8c0a4a5b062a56e5494894aa86b89a21a86ea3e (patch) | |
tree | 5d237970244ed1550ad402ea0d8c38df1bda5306 /drivers | |
parent | 003fb4d9a0f16ffcf2d133469941c87824cd641b (diff) | |
parent | 83e756cbc3fc1689d40567b71511adc1089f85e0 (diff) | |
download | kernel_samsung_smdk4412-a8c0a4a5b062a56e5494894aa86b89a21a86ea3e.tar.gz kernel_samsung_smdk4412-a8c0a4a5b062a56e5494894aa86b89a21a86ea3e.tar.bz2 kernel_samsung_smdk4412-a8c0a4a5b062a56e5494894aa86b89a21a86ea3e.zip |
Merge "Samsung i9300 Update 10" into cm-10.1
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/motor/tspdrv.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/motor/tspdrv.c b/drivers/motor/tspdrv.c index 73cb2772edb..b22bb0534c2 100644 --- a/drivers/motor/tspdrv.c +++ b/drivers/motor/tspdrv.c @@ -380,6 +380,12 @@ static ssize_t write(struct file *file, const char *buf, size_t count, return 0; } + /* Check buffer size */ + if ((count <= SPI_HEADER_SIZE) || (count > SPI_BUFFER_SIZE)) { + DbgOut((KERN_ERR "tspdrv: invalid write buffer size.\n")); + return 0; + } + /* Copy immediately the input buffer */ if (0 != copy_from_user(g_cWriteBuffer, buf, count)) { /* Failed to copy all the data, exit */ @@ -387,12 +393,6 @@ static ssize_t write(struct file *file, const char *buf, size_t count, return 0; } - /* Check buffer size */ - if ((count <= SPI_HEADER_SIZE) || (count > SPI_BUFFER_SIZE)) { - DbgOut((KERN_ERR "tspdrv: invalid write buffer size.\n")); - return 0; - } - while (i < count) { int nIndexFreeBuffer; /* initialized below */ |