mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 22:40:54 -04:00
fix random crashes due to floating point operation
Unprotected floating point operation in kernel might corrupt NEON register and cause many random native crashes. Add kernel_neon_begin and kenrel_neon_end to protect floating point operation in wt6670f module. Change-Id: I2a3a4a3ac1ce78513211ca669eb25c808653f0cc Reviewed-on: https://gerrit.mot.com/2251071 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Wang Wang <wangwang1@lenovo.com> Submit-Approved: Jira Key
This commit is contained in:
parent
e04e7a7ec5
commit
11664d82f8
1 changed files with 5 additions and 1 deletions
|
|
@ -20,6 +20,7 @@
|
|||
#include "wt6670f.h"
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <asm/neon.h>
|
||||
|
||||
#define MAX_USER_STR 1024
|
||||
|
||||
|
|
@ -154,7 +155,10 @@ static u16 wt6670f_get_vbus_voltage(void)
|
|||
|
||||
pr_err(">>>>>>wt6670f get vbus voltage = %04x %02x %02x\n", tmp,
|
||||
data[0], data[1]);
|
||||
return (u16)(tmp * 18.98);
|
||||
kernel_neon_begin();
|
||||
tmp = (u16)(tmp * 18.98);
|
||||
kernel_neon_end();
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static u16 wt6670f_get_id(u8 reg)
|
||||
|
|
|
|||
Loading…
Reference in a new issue