Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 96d5d915 authored by Lee Susman's avatar Lee Susman
Browse files

mmc: card: fix mmc_block_test read handler return value



In case of illegal buffer passed down by user, return -EFAULT instead
of count.

Change-Id: I2ce2ba5e8d26245fe828e8b6f102c218125bdf3b
Signed-off-by: default avatarLee Susman <lsusman@codeaurora.org>
parent ddc46d3a
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -2218,7 +2218,7 @@ static ssize_t send_write_packing_test_read(struct file *file,
			       loff_t *offset)
{
	if (!access_ok(VERIFY_WRITE, buffer, count))
		return count;
		return -EFAULT;

	memset((void *)buffer, 0, count);

@@ -2319,7 +2319,7 @@ static ssize_t err_check_test_read(struct file *file,
			       loff_t *offset)
{
	if (!access_ok(VERIFY_WRITE, buffer, count))
		return count;
		return -EFAULT;

	memset((void *)buffer, 0, count);

@@ -2430,7 +2430,7 @@ static ssize_t send_invalid_packed_test_read(struct file *file,
			       loff_t *offset)
{
	if (!access_ok(VERIFY_WRITE, buffer, count))
		return count;
		return -EFAULT;

	memset((void *)buffer, 0, count);

@@ -2547,7 +2547,7 @@ static ssize_t write_packing_control_test_read(struct file *file,
			       loff_t *offset)
{
	if (!access_ok(VERIFY_WRITE, buffer, count))
		return count;
		return -EFAULT;

	memset((void *)buffer, 0, count);

@@ -2632,7 +2632,7 @@ static ssize_t bkops_test_read(struct file *file,
			       loff_t *offset)
{
	if (!access_ok(VERIFY_WRITE, buffer, count))
		return count;
		return -EFAULT;

	memset((void *)buffer, 0, count);

@@ -2723,7 +2723,7 @@ static ssize_t long_sequential_read_test_read(struct file *file,
			       loff_t *offset)
{
	if (!access_ok(VERIFY_WRITE, buffer, count))
		return count;
		return -EFAULT;

	memset((void *)buffer, 0, count);

@@ -2886,7 +2886,7 @@ static ssize_t long_sequential_write_test_read(struct file *file,
			       loff_t *offset)
{
	if (!access_ok(VERIFY_WRITE, buffer, count))
		return count;
		return -EFAULT;

	memset((void *)buffer, 0, count);

@@ -2962,7 +2962,7 @@ static ssize_t new_req_notification_test_read(struct file *file,
			       loff_t *offset)
{
	if (!access_ok(VERIFY_WRITE, buffer, count))
		return count;
		return -EFAULT;

	memset((void *)buffer, 0, count);