summaryrefslogtreecommitdiffstats
path: root/drivers/s390/block/dasd_ioctl.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-09-16 07:09:02 +0200
committerDavid S. Miller <davem@davemloft.net>2011-09-16 07:09:02 +0200
commit52b9aca7ae8726d1fb41b97dd1d243d107fef11b (patch)
tree7acee111840bd25183513e9bde08e939ffd57be8 /drivers/s390/block/dasd_ioctl.c
parentpch_gbe: support ML7831 IOH (diff)
parente1000: Fix driver to be used on PA RISC C8000 workstations (diff)
downloadlinux-52b9aca7ae8726d1fb41b97dd1d243d107fef11b.tar.xz
linux-52b9aca7ae8726d1fb41b97dd1d243d107fef11b.zip
Merge branch 'master' of ../netdev/
Diffstat (limited to 'drivers/s390/block/dasd_ioctl.c')
-rw-r--r--drivers/s390/block/dasd_ioctl.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c
index eb4e034378cd..f1a2016829fc 100644
--- a/drivers/s390/block/dasd_ioctl.c
+++ b/drivers/s390/block/dasd_ioctl.c
@@ -249,6 +249,7 @@ static int dasd_ioctl_reset_profile(struct dasd_block *block)
static int dasd_ioctl_read_profile(struct dasd_block *block, void __user *argp)
{
struct dasd_profile_info_t *data;
+ int rc = 0;
data = kmalloc(sizeof(*data), GFP_KERNEL);
if (!data)
@@ -279,11 +280,14 @@ static int dasd_ioctl_read_profile(struct dasd_block *block, void __user *argp)
spin_unlock_bh(&block->profile.lock);
} else {
spin_unlock_bh(&block->profile.lock);
- return -EIO;
+ rc = -EIO;
+ goto out;
}
if (copy_to_user(argp, data, sizeof(*data)))
- return -EFAULT;
- return 0;
+ rc = -EFAULT;
+out:
+ kfree(data);
+ return rc;
}
#else
static int dasd_ioctl_reset_profile(struct dasd_block *block)