Skip to content

Commit

Permalink
[SCSI] zfcp: add missing compat ptr conversion
Browse files Browse the repository at this point in the history
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
  • Loading branch information
Heiko Carstens authored and James Bottomley committed Jan 17, 2010
1 parent 5a3fb30 commit 9e2ab1f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/s390/scsi/zfcp_cfdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include <linux/types.h>
#include <linux/miscdevice.h>
#include <asm/compat.h>
#include <asm/ccwdev.h>
#include "zfcp_def.h"
#include "zfcp_ext.h"
Expand Down Expand Up @@ -163,7 +164,7 @@ static void zfcp_cfdc_req_to_sense(struct zfcp_cfdc_data *data,
}

static long zfcp_cfdc_dev_ioctl(struct file *file, unsigned int command,
unsigned long buffer)
unsigned long arg)
{
struct zfcp_cfdc_data *data;
struct zfcp_cfdc_data __user *data_user;
Expand All @@ -175,7 +176,11 @@ static long zfcp_cfdc_dev_ioctl(struct file *file, unsigned int command,
if (command != ZFCP_CFDC_IOC)
return -ENOTTY;

data_user = (void __user *) buffer;
if (is_compat_task())
data_user = compat_ptr(arg);
else
data_user = (void __user *)arg;

if (!data_user)
return -EINVAL;

Expand Down

0 comments on commit 9e2ab1f

Please sign in to comment.