From: 郭毅 Date: Wed, 19 Mar 2014 08:26:32 +0000 (+0800) Subject: sensors: compass: fix null point on m_layout X-Git-Tag: firefly_0821_release~6001^2~5 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e264d713f5133e2dae02985e7c4dc89477750a9d;p=firefly-linux-kernel-4.4.55.git sensors: compass: fix null point on m_layout --- 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) {