/*
- * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2015, 2017, 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
if (copy_from_user(&usr_blk.payload, &local_blk->payload,
sizeof(struct blk_payload)) != 0)
return -EFAULT;
+ } else {
+ return -EFAULT;
}
idx = ret = 0;
now = current_kernel_time();
{
unsigned int byte_num = index/8;
unsigned int bit_num = index%8;
- unsigned char byte = pVec[byte_num];
+ unsigned char byte;
+
+ if (DIV_ROUND_UP(index, 8) > MASK_BUFFER_SIZE)
+ return false;
+
+ byte = pVec[byte_num];
return !(byte & (1 << bit_num));
}