Browse Source

[SCSI] zfcp: add missing compat ptr conversion

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>
Heiko Carstens 15 years ago
parent
commit
9e2ab1fabd
1 changed files with 7 additions and 2 deletions
  1. 7 2
      drivers/s390/scsi/zfcp_cfdc.c

+ 7 - 2
drivers/s390/scsi/zfcp_cfdc.c

@@ -12,6 +12,7 @@
 
 
 #include <linux/types.h>
 #include <linux/types.h>
 #include <linux/miscdevice.h>
 #include <linux/miscdevice.h>
+#include <asm/compat.h>
 #include <asm/ccwdev.h>
 #include <asm/ccwdev.h>
 #include "zfcp_def.h"
 #include "zfcp_def.h"
 #include "zfcp_ext.h"
 #include "zfcp_ext.h"
@@ -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,
 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 *data;
 	struct zfcp_cfdc_data __user *data_user;
 	struct zfcp_cfdc_data __user *data_user;
@@ -175,7 +176,11 @@ static long zfcp_cfdc_dev_ioctl(struct file *file, unsigned int command,
 	if (command != ZFCP_CFDC_IOC)
 	if (command != ZFCP_CFDC_IOC)
 		return -ENOTTY;
 		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)
 	if (!data_user)
 		return -EINVAL;
 		return -EINVAL;