* [PATCH] udlfb: Fix memory leak in dlfb_usb_probe
@ 2020-12-15 6:30 ` qiang.zhang
0 siblings, 0 replies; 4+ messages in thread
From: qiang.zhang @ 2020-12-15 6:30 UTC (permalink / raw)
To: b.zolnierkie; +Cc: mpatocka, bernie, dri-devel, linux-fbdev, linux-kernel
From: Zqiang <qiang.zhang@windriver.com>
The dlfb_alloc_urb_list function is called in dlfb_usb_probe function,
after that if an error occurs, the dlfb_free_urb_list function need to
be called.
BUG: memory leak
unreferenced object 0xffff88810adde100 (size 32):
comm "kworker/1:0", pid 17, jiffies 4294947788 (age 19.520s)
hex dump (first 32 bytes):
10 30 c3 0d 81 88 ff ff c0 fa 63 12 81 88 ff ff .0........c.....
00 30 c3 0d 81 88 ff ff 80 d1 3a 08 81 88 ff ff .0........:.....
backtrace:
[<0000000019512953>] kmalloc include/linux/slab.h:552 [inline]
[<0000000019512953>] kzalloc include/linux/slab.h:664 [inline]
[<0000000019512953>] dlfb_alloc_urb_list drivers/video/fbdev/udlfb.c:1892 [inline]
[<0000000019512953>] dlfb_usb_probe.cold+0x289/0x988 drivers/video/fbdev/udlfb.c:1704
[<0000000072160152>] usb_probe_interface+0x177/0x370 drivers/usb/core/driver.c:396
[<00000000a8d6726f>] really_probe+0x159/0x480 drivers/base/dd.c:554
[<00000000c3ce4b0e>] driver_probe_device+0x84/0x100 drivers/base/dd.c:738
[<00000000e942e01c>] __device_attach_driver+0xee/0x110 drivers/base/dd.c:844
[<00000000de0a5a5c>] bus_for_each_drv+0xb7/0x100 drivers/base/bus.c:431
[<00000000463fbcb4>] __device_attach+0x122/0x250 drivers/base/dd.c:912
[<00000000b881a711>] bus_probe_device+0xc6/0xe0 drivers/base/bus.c:491
[<00000000364bbda5>] device_add+0x5ac/0xc30 drivers/base/core.c:2936
[<00000000eecca418>] usb_set_configuration+0x9de/0xb90 drivers/usb/core/message.c:2159
[<00000000edfeca2d>] usb_generic_driver_probe+0x8c/0xc0 drivers/usb/core/generic.c:238
[<000000001830872b>] usb_probe_device+0x5c/0x140 drivers/usb/core/driver.c:293
[<00000000a8d6726f>] really_probe+0x159/0x480 drivers/base/dd.c:554
[<00000000c3ce4b0e>] driver_probe_device+0x84/0x100 drivers/base/dd.c:738
[<00000000e942e01c>] __device_attach_driver+0xee/0x110 drivers/base/dd.c:844
[<00000000de0a5a5c>] bus_for_each_drv+0xb7/0x100 drivers/base/bus.c:431
Reported-by: syzbot+c9e365d7f450e8aa615d@syzkaller.appspotmail.com
Signed-off-by: Zqiang <qiang.zhang@windriver.com>
---
drivers/video/fbdev/udlfb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c
index f9b3c1cb9530..b9cdd02c1000 100644
--- a/drivers/video/fbdev/udlfb.c
+++ b/drivers/video/fbdev/udlfb.c
@@ -1017,6 +1017,7 @@ static void dlfb_ops_destroy(struct fb_info *info)
}
vfree(dlfb->backing_buffer);
kfree(dlfb->edid);
+ dlfb_free_urb_list(dlfb);
usb_put_dev(dlfb->udev);
kfree(dlfb);
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] udlfb: Fix memory leak in dlfb_usb_probe
@ 2020-12-15 6:30 ` qiang.zhang
0 siblings, 0 replies; 4+ messages in thread
From: qiang.zhang @ 2020-12-15 6:30 UTC (permalink / raw)
To: b.zolnierkie; +Cc: linux-fbdev, mpatocka, bernie, dri-devel, linux-kernel
From: Zqiang <qiang.zhang@windriver.com>
The dlfb_alloc_urb_list function is called in dlfb_usb_probe function,
after that if an error occurs, the dlfb_free_urb_list function need to
be called.
BUG: memory leak
unreferenced object 0xffff88810adde100 (size 32):
comm "kworker/1:0", pid 17, jiffies 4294947788 (age 19.520s)
hex dump (first 32 bytes):
10 30 c3 0d 81 88 ff ff c0 fa 63 12 81 88 ff ff .0........c.....
00 30 c3 0d 81 88 ff ff 80 d1 3a 08 81 88 ff ff .0........:.....
backtrace:
[<0000000019512953>] kmalloc include/linux/slab.h:552 [inline]
[<0000000019512953>] kzalloc include/linux/slab.h:664 [inline]
[<0000000019512953>] dlfb_alloc_urb_list drivers/video/fbdev/udlfb.c:1892 [inline]
[<0000000019512953>] dlfb_usb_probe.cold+0x289/0x988 drivers/video/fbdev/udlfb.c:1704
[<0000000072160152>] usb_probe_interface+0x177/0x370 drivers/usb/core/driver.c:396
[<00000000a8d6726f>] really_probe+0x159/0x480 drivers/base/dd.c:554
[<00000000c3ce4b0e>] driver_probe_device+0x84/0x100 drivers/base/dd.c:738
[<00000000e942e01c>] __device_attach_driver+0xee/0x110 drivers/base/dd.c:844
[<00000000de0a5a5c>] bus_for_each_drv+0xb7/0x100 drivers/base/bus.c:431
[<00000000463fbcb4>] __device_attach+0x122/0x250 drivers/base/dd.c:912
[<00000000b881a711>] bus_probe_device+0xc6/0xe0 drivers/base/bus.c:491
[<00000000364bbda5>] device_add+0x5ac/0xc30 drivers/base/core.c:2936
[<00000000eecca418>] usb_set_configuration+0x9de/0xb90 drivers/usb/core/message.c:2159
[<00000000edfeca2d>] usb_generic_driver_probe+0x8c/0xc0 drivers/usb/core/generic.c:238
[<000000001830872b>] usb_probe_device+0x5c/0x140 drivers/usb/core/driver.c:293
[<00000000a8d6726f>] really_probe+0x159/0x480 drivers/base/dd.c:554
[<00000000c3ce4b0e>] driver_probe_device+0x84/0x100 drivers/base/dd.c:738
[<00000000e942e01c>] __device_attach_driver+0xee/0x110 drivers/base/dd.c:844
[<00000000de0a5a5c>] bus_for_each_drv+0xb7/0x100 drivers/base/bus.c:431
Reported-by: syzbot+c9e365d7f450e8aa615d@syzkaller.appspotmail.com
Signed-off-by: Zqiang <qiang.zhang@windriver.com>
---
drivers/video/fbdev/udlfb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c
index f9b3c1cb9530..b9cdd02c1000 100644
--- a/drivers/video/fbdev/udlfb.c
+++ b/drivers/video/fbdev/udlfb.c
@@ -1017,6 +1017,7 @@ static void dlfb_ops_destroy(struct fb_info *info)
}
vfree(dlfb->backing_buffer);
kfree(dlfb->edid);
+ dlfb_free_urb_list(dlfb);
usb_put_dev(dlfb->udev);
kfree(dlfb);
--
2.17.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] udlfb: Fix memory leak in dlfb_usb_probe
2020-12-15 6:30 ` qiang.zhang
@ 2020-12-15 9:55 ` Daniel Vetter
-1 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2020-12-15 9:55 UTC (permalink / raw)
To: qiang.zhang
Cc: b.zolnierkie, linux-fbdev, mpatocka, bernie, dri-devel, linux-kernel
On Tue, Dec 15, 2020 at 02:30:22PM +0800, qiang.zhang@windriver.com wrote:
> From: Zqiang <qiang.zhang@windriver.com>
>
> The dlfb_alloc_urb_list function is called in dlfb_usb_probe function,
> after that if an error occurs, the dlfb_free_urb_list function need to
> be called.
>
> BUG: memory leak
> unreferenced object 0xffff88810adde100 (size 32):
> comm "kworker/1:0", pid 17, jiffies 4294947788 (age 19.520s)
> hex dump (first 32 bytes):
> 10 30 c3 0d 81 88 ff ff c0 fa 63 12 81 88 ff ff .0........c.....
> 00 30 c3 0d 81 88 ff ff 80 d1 3a 08 81 88 ff ff .0........:.....
> backtrace:
> [<0000000019512953>] kmalloc include/linux/slab.h:552 [inline]
> [<0000000019512953>] kzalloc include/linux/slab.h:664 [inline]
> [<0000000019512953>] dlfb_alloc_urb_list drivers/video/fbdev/udlfb.c:1892 [inline]
> [<0000000019512953>] dlfb_usb_probe.cold+0x289/0x988 drivers/video/fbdev/udlfb.c:1704
> [<0000000072160152>] usb_probe_interface+0x177/0x370 drivers/usb/core/driver.c:396
> [<00000000a8d6726f>] really_probe+0x159/0x480 drivers/base/dd.c:554
> [<00000000c3ce4b0e>] driver_probe_device+0x84/0x100 drivers/base/dd.c:738
> [<00000000e942e01c>] __device_attach_driver+0xee/0x110 drivers/base/dd.c:844
> [<00000000de0a5a5c>] bus_for_each_drv+0xb7/0x100 drivers/base/bus.c:431
> [<00000000463fbcb4>] __device_attach+0x122/0x250 drivers/base/dd.c:912
> [<00000000b881a711>] bus_probe_device+0xc6/0xe0 drivers/base/bus.c:491
> [<00000000364bbda5>] device_add+0x5ac/0xc30 drivers/base/core.c:2936
> [<00000000eecca418>] usb_set_configuration+0x9de/0xb90 drivers/usb/core/message.c:2159
> [<00000000edfeca2d>] usb_generic_driver_probe+0x8c/0xc0 drivers/usb/core/generic.c:238
> [<000000001830872b>] usb_probe_device+0x5c/0x140 drivers/usb/core/driver.c:293
> [<00000000a8d6726f>] really_probe+0x159/0x480 drivers/base/dd.c:554
> [<00000000c3ce4b0e>] driver_probe_device+0x84/0x100 drivers/base/dd.c:738
> [<00000000e942e01c>] __device_attach_driver+0xee/0x110 drivers/base/dd.c:844
> [<00000000de0a5a5c>] bus_for_each_drv+0xb7/0x100 drivers/base/bus.c:431
>
> Reported-by: syzbot+c9e365d7f450e8aa615d@syzkaller.appspotmail.com
> Signed-off-by: Zqiang <qiang.zhang@windriver.com>
Queued up in drm-misc-next, thanks for your patch.
-Daniel
> ---
> drivers/video/fbdev/udlfb.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c
> index f9b3c1cb9530..b9cdd02c1000 100644
> --- a/drivers/video/fbdev/udlfb.c
> +++ b/drivers/video/fbdev/udlfb.c
> @@ -1017,6 +1017,7 @@ static void dlfb_ops_destroy(struct fb_info *info)
> }
> vfree(dlfb->backing_buffer);
> kfree(dlfb->edid);
> + dlfb_free_urb_list(dlfb);
> usb_put_dev(dlfb->udev);
> kfree(dlfb);
>
> --
> 2.17.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] udlfb: Fix memory leak in dlfb_usb_probe
@ 2020-12-15 9:55 ` Daniel Vetter
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2020-12-15 9:55 UTC (permalink / raw)
To: qiang.zhang
Cc: linux-fbdev, b.zolnierkie, linux-kernel, dri-devel, bernie, mpatocka
On Tue, Dec 15, 2020 at 02:30:22PM +0800, qiang.zhang@windriver.com wrote:
> From: Zqiang <qiang.zhang@windriver.com>
>
> The dlfb_alloc_urb_list function is called in dlfb_usb_probe function,
> after that if an error occurs, the dlfb_free_urb_list function need to
> be called.
>
> BUG: memory leak
> unreferenced object 0xffff88810adde100 (size 32):
> comm "kworker/1:0", pid 17, jiffies 4294947788 (age 19.520s)
> hex dump (first 32 bytes):
> 10 30 c3 0d 81 88 ff ff c0 fa 63 12 81 88 ff ff .0........c.....
> 00 30 c3 0d 81 88 ff ff 80 d1 3a 08 81 88 ff ff .0........:.....
> backtrace:
> [<0000000019512953>] kmalloc include/linux/slab.h:552 [inline]
> [<0000000019512953>] kzalloc include/linux/slab.h:664 [inline]
> [<0000000019512953>] dlfb_alloc_urb_list drivers/video/fbdev/udlfb.c:1892 [inline]
> [<0000000019512953>] dlfb_usb_probe.cold+0x289/0x988 drivers/video/fbdev/udlfb.c:1704
> [<0000000072160152>] usb_probe_interface+0x177/0x370 drivers/usb/core/driver.c:396
> [<00000000a8d6726f>] really_probe+0x159/0x480 drivers/base/dd.c:554
> [<00000000c3ce4b0e>] driver_probe_device+0x84/0x100 drivers/base/dd.c:738
> [<00000000e942e01c>] __device_attach_driver+0xee/0x110 drivers/base/dd.c:844
> [<00000000de0a5a5c>] bus_for_each_drv+0xb7/0x100 drivers/base/bus.c:431
> [<00000000463fbcb4>] __device_attach+0x122/0x250 drivers/base/dd.c:912
> [<00000000b881a711>] bus_probe_device+0xc6/0xe0 drivers/base/bus.c:491
> [<00000000364bbda5>] device_add+0x5ac/0xc30 drivers/base/core.c:2936
> [<00000000eecca418>] usb_set_configuration+0x9de/0xb90 drivers/usb/core/message.c:2159
> [<00000000edfeca2d>] usb_generic_driver_probe+0x8c/0xc0 drivers/usb/core/generic.c:238
> [<000000001830872b>] usb_probe_device+0x5c/0x140 drivers/usb/core/driver.c:293
> [<00000000a8d6726f>] really_probe+0x159/0x480 drivers/base/dd.c:554
> [<00000000c3ce4b0e>] driver_probe_device+0x84/0x100 drivers/base/dd.c:738
> [<00000000e942e01c>] __device_attach_driver+0xee/0x110 drivers/base/dd.c:844
> [<00000000de0a5a5c>] bus_for_each_drv+0xb7/0x100 drivers/base/bus.c:431
>
> Reported-by: syzbot+c9e365d7f450e8aa615d@syzkaller.appspotmail.com
> Signed-off-by: Zqiang <qiang.zhang@windriver.com>
Queued up in drm-misc-next, thanks for your patch.
-Daniel
> ---
> drivers/video/fbdev/udlfb.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c
> index f9b3c1cb9530..b9cdd02c1000 100644
> --- a/drivers/video/fbdev/udlfb.c
> +++ b/drivers/video/fbdev/udlfb.c
> @@ -1017,6 +1017,7 @@ static void dlfb_ops_destroy(struct fb_info *info)
> }
> vfree(dlfb->backing_buffer);
> kfree(dlfb->edid);
> + dlfb_free_urb_list(dlfb);
> usb_put_dev(dlfb->udev);
> kfree(dlfb);
>
> --
> 2.17.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-12-15 9:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-15 6:30 [PATCH] udlfb: Fix memory leak in dlfb_usb_probe qiang.zhang
2020-12-15 6:30 ` qiang.zhang
2020-12-15 9:55 ` Daniel Vetter
2020-12-15 9:55 ` Daniel Vetter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.