From e264d713f5133e2dae02985e7c4dc89477750a9d Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=83=AD=E6=AF=85?= Date: Wed, 19 Mar 2014 16:26:32 +0800 Subject: [PATCH] sensors: compass: fix null point on m_layout --- drivers/input/sensors/compass/ak09911.c | 4 ++-- drivers/input/sensors/compass/ak8963.c | 4 ++-- drivers/input/sensors/compass/ak8975.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/input/sensors/compass/ak09911.c b/drivers/input/sensors/compass/ak09911.c index ac7c681d763f..15e52c5f448a 100755 --- a/drivers/input/sensors/compass/ak09911.c +++ b/drivers/input/sensors/compass/ak09911.c @@ -624,8 +624,8 @@ static long compass_dev_ioctl(struct file *file, case ECS_IOCTL_GET_PLATFORM_DATA: DBG("%s:ECS_IOCTL_GET_PLATFORM_DATA start\n",__func__); - memcpy(compass.m_layout, sensor->pdata->m_layout, sizeof(sensor->pdata->m_layout)); - memcpy(compass.project_name, sensor->pdata->project_name, sizeof(sensor->pdata->project_name)); + // memcpy(compass.m_layout, sensor->pdata->m_layout, sizeof(sensor->pdata->m_layout)); + // memcpy(compass.project_name, sensor->pdata->project_name, sizeof(sensor->pdata->project_name)); ret = copy_to_user(argp, &compass, sizeof(compass)); if(ret < 0) { diff --git a/drivers/input/sensors/compass/ak8963.c b/drivers/input/sensors/compass/ak8963.c index 318377e03395..d9e4c0ebe4ad 100755 --- a/drivers/input/sensors/compass/ak8963.c +++ b/drivers/input/sensors/compass/ak8963.c @@ -625,8 +625,8 @@ static long compass_dev_ioctl(struct file *file, case ECS_IOCTL_GET_PLATFORM_DATA: DBG("%s:ECS_IOCTL_GET_PLATFORM_DATA start\n",__func__); - memcpy(compass.m_layout, sensor->pdata->m_layout, sizeof(sensor->pdata->m_layout)); - memcpy(compass.project_name, sensor->pdata->project_name, sizeof(sensor->pdata->project_name)); + //memcpy(compass.m_layout, sensor->pdata->m_layout, sizeof(sensor->pdata->m_layout)); + //memcpy(compass.project_name, sensor->pdata->project_name, sizeof(sensor->pdata->project_name)); ret = copy_to_user(argp, &compass, sizeof(compass)); if(ret < 0) { diff --git a/drivers/input/sensors/compass/ak8975.c b/drivers/input/sensors/compass/ak8975.c index 1ed0f29712ab..3d372cb7230e 100755 --- a/drivers/input/sensors/compass/ak8975.c +++ b/drivers/input/sensors/compass/ak8975.c @@ -547,8 +547,8 @@ static long compass_dev_ioctl(struct file *file, break; case ECS_IOCTL_GET_PLATFORM_DATA: DBG("%s:ECS_IOCTL_GET_PLATFORM_DATA start\n",__func__); - memcpy(compass.m_layout, sensor->pdata->m_layout, sizeof(sensor->pdata->m_layout)); - memcpy(compass.project_name, sensor->pdata->project_name, sizeof(sensor->pdata->project_name)); + //memcpy(compass.m_layout, sensor->pdata->m_layout, sizeof(sensor->pdata->m_layout)); + //memcpy(compass.project_name, sensor->pdata->project_name, sizeof(sensor->pdata->project_name)); ret = copy_to_user(argp, &compass, sizeof(compass)); if(ret < 0) { -- 2.34.1