summaryrefslogtreecommitdiffstats
path: root/drivers/misc/mic/vop
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-02-12 09:40:26 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-14 17:42:37 -0800
commit6ddf2f0cb1e1931d16e08e30130ed04e5a441f2c (patch)
tree704e08f879fb6b9f57e9b99f5603f144f0031778 /drivers/misc/mic/vop
parent1b79dff672ca09a5461cc1d46ad81c62137841c5 (diff)
downloadblackbird-op-linux-6ddf2f0cb1e1931d16e08e30130ed04e5a441f2c.tar.gz
blackbird-op-linux-6ddf2f0cb1e1931d16e08e30130ed04e5a441f2c.zip
misc: mic: use after free printing error message
Swap the printk and kfree() to avoid a use after free bug. Fixes: 61e9c905df78 ('misc: mic: Enable VOP host side functionality') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mic/vop')
-rw-r--r--drivers/misc/mic/vop/vop_vringh.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/mic/vop/vop_vringh.c b/drivers/misc/mic/vop/vop_vringh.c
index c1dd000f042b..c3613f39eb35 100644
--- a/drivers/misc/mic/vop/vop_vringh.c
+++ b/drivers/misc/mic/vop/vop_vringh.c
@@ -290,9 +290,9 @@ static int vop_virtio_add_device(struct vop_vdev *vdev,
ret = vop_copy_dp_entry(vdev, argp, &type, &dd);
if (ret) {
- kfree(vdev);
dev_err(vop_dev(vdev), "%s %d err %d\n",
__func__, __LINE__, ret);
+ kfree(vdev);
return ret;
}
OpenPOWER on IntegriCloud