forked from rubenslte/android_kernel_samsung_msm8226
Merge "ASoC: wcd9xxx: Fix unprotected userspace access" into LA.BF.1.1.3_rb1.15
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
commit
293bf65264
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2014-2015, 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
|
||||
@@ -83,7 +83,8 @@ static int wcdcal_hwdep_ioctl_shared(struct snd_hwdep *hw,
|
||||
return -EFAULT;
|
||||
}
|
||||
data = fw[fw_user.cal_type]->data;
|
||||
memcpy(data, fw_user.buffer, fw_user.size);
|
||||
if (copy_from_user(data, fw_user.buffer, fw_user.size))
|
||||
return -EFAULT;
|
||||
fw[fw_user.cal_type]->size = fw_user.size;
|
||||
mutex_lock(&fw_data->lock);
|
||||
set_bit(WCDCAL_RECIEVED, &fw_data->wcdcal_state[fw_user.cal_type]);
|
||||
|
||||
Reference in New Issue
Block a user