Merge "ASoC: wcd9xxx: Fix unprotected userspace access" into LA.BF.1.1.3_rb1.15

This commit is contained in:
Linux Build Service Account
2017-01-28 21:47:43 -08:00
committed by Gerrit - the friendly Code Review server
+3 -2
View File
@@ -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]);