summaryrefslogtreecommitdiffstats
path: root/drivers/video/fbdev/udlfb.c
diff options
context:
space:
mode:
authorAnton Vasilyev <vasilyev@ispras.ru>2017-08-21 16:49:58 +0200
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2017-08-21 16:49:58 +0200
commit7af9a52e33ea07937fc216104e2cf3d4e690b43f (patch)
tree9e1e1192883abd93f5edfa81192340d3ceba51b7 /drivers/video/fbdev/udlfb.c
parent8bf25eadb37cedcaedd6099431b95633d487688f (diff)
downloadlinux-7af9a52e33ea07937fc216104e2cf3d4e690b43f.tar.bz2
video: fbdev: udlfb: Fix use after free on dlfb_usb_probe error path
If dlfb_usb_probe drops to error path then there is only one kref_init() call and no kref_get(), so second kref_put() leads to use after free. The patch removes superfluous kref_put on dlfb_usb_probe error path. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev <vasilyev@ispras.ru> Cc: Bernie Thompson <bernie@plugable.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Diffstat (limited to 'drivers/video/fbdev/udlfb.c')
-rw-r--r--drivers/video/fbdev/udlfb.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c
index d0d29743dae2..ef08a104fb42 100644
--- a/drivers/video/fbdev/udlfb.c
+++ b/drivers/video/fbdev/udlfb.c
@@ -1655,7 +1655,6 @@ static int dlfb_usb_probe(struct usb_interface *interface,
error:
if (dev) {
- kref_put(&dev->kref, dlfb_free); /* ref for framebuffer */
kref_put(&dev->kref, dlfb_free); /* last ref from kref_init */
/* dev has been deallocated. Do not dereference */