pmem: Check for valid virtual address while flushing
Return invalid error if a NULL virtual address is passed for pmem cache maintenance ioctl's Change-Id: I18c369d4c2ac790b622408a988d171d6f75c4cd3 Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
This commit is contained in:
@@ -1970,6 +1970,13 @@ int pmem_cache_maint(struct file *file, unsigned int cmd,
|
||||
if (!file)
|
||||
return -EBADF;
|
||||
|
||||
/*
|
||||
* check that the vaddr passed for flushing is valid
|
||||
* so that you don't crash the kernel
|
||||
*/
|
||||
if (!pmem_addr->vaddr)
|
||||
return -EINVAL;
|
||||
|
||||
data = file->private_data;
|
||||
id = get_id(file);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user