Home Home > GIT Browse > SLE12-SP4
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-08-08 12:21:57 +0200
committerTakashi Iwai <tiwai@suse.de>2019-08-08 12:21:58 +0200
commit92dbc279d016e4a5ec615f675bbe24d4cbc57412 (patch)
tree720e18e11cfc8b1f70c59dcc2e5bcb2bbf4c144c
parent7ca0aa7c9e8d525c4327160da7b22bbccb84aea3 (diff)
drm/nouveau: fix memory leak in nouveau_conn_reset()
(bsc#1051510).
-rw-r--r--patches.drm/drm-nouveau-fix-memory-leak-in-nouveau_conn_reset.patch63
-rw-r--r--series.conf1
2 files changed, 64 insertions, 0 deletions
diff --git a/patches.drm/drm-nouveau-fix-memory-leak-in-nouveau_conn_reset.patch b/patches.drm/drm-nouveau-fix-memory-leak-in-nouveau_conn_reset.patch
new file mode 100644
index 0000000000..d70b00faf8
--- /dev/null
+++ b/patches.drm/drm-nouveau-fix-memory-leak-in-nouveau_conn_reset.patch
@@ -0,0 +1,63 @@
+From 09b90e2fe35faeace2488234e2a7728f2ea8ba26 Mon Sep 17 00:00:00 2001
+From: Yongxin Liu <yongxin.liu@windriver.com>
+Date: Mon, 1 Jul 2019 09:46:22 +0800
+Subject: [PATCH] drm/nouveau: fix memory leak in nouveau_conn_reset()
+Git-commit: 09b90e2fe35faeace2488234e2a7728f2ea8ba26
+Patch-mainline: v5.3-rc1
+References: bsc#1051510
+
+In nouveau_conn_reset(), if connector->state is true,
+__drm_atomic_helper_connector_destroy_state() will be called,
+but the memory pointed by asyc isn't freed. Memory leak happens
+in the following function __drm_atomic_helper_connector_reset(),
+where newly allocated asyc->state will be assigned to connector->state.
+
+So using nouveau_conn_atomic_destroy_state() instead of
+__drm_atomic_helper_connector_destroy_state to free the "old" asyc.
+
+Here the is the log showing memory leak.
+
+unreferenced object 0xffff8c5480483c80 (size 192):
+ comm "kworker/0:2", pid 188, jiffies 4294695279 (age 53.179s)
+ hex dump (first 32 bytes):
+ 00 f0 ba 7b 54 8c ff ff 00 00 00 00 00 00 00 00 ...{T...........
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ backtrace:
+ [<000000005005c0d0>] kmem_cache_alloc_trace+0x195/0x2c0
+ [<00000000a122baed>] nouveau_conn_reset+0x25/0xc0 [nouveau]
+ [<000000004fd189a2>] nouveau_connector_create+0x3a7/0x610 [nouveau]
+ [<00000000c73343a8>] nv50_display_create+0x343/0x980 [nouveau]
+ [<000000002e2b03c3>] nouveau_display_create+0x51f/0x660 [nouveau]
+ [<00000000c924699b>] nouveau_drm_device_init+0x182/0x7f0 [nouveau]
+ [<00000000cc029436>] nouveau_drm_probe+0x20c/0x2c0 [nouveau]
+ [<000000007e961c3e>] local_pci_probe+0x47/0xa0
+ [<00000000da14d569>] work_for_cpu_fn+0x1a/0x30
+ [<0000000028da4805>] process_one_work+0x27c/0x660
+ [<000000001d415b04>] worker_thread+0x22b/0x3f0
+ [<0000000003b69f1f>] kthread+0x12f/0x150
+ [<00000000c94c29b7>] ret_from_fork+0x3a/0x50
+
+Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/gpu/drm/nouveau/nouveau_connector.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
+index caa8c7595889..8f15281faa79 100644
+--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
++++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
+@@ -252,7 +252,7 @@ nouveau_conn_reset(struct drm_connector *connector)
+ return;
+
+ if (connector->state)
+- __drm_atomic_helper_connector_destroy_state(connector->state);
++ nouveau_conn_atomic_destroy_state(connector, connector->state);
+ __drm_atomic_helper_connector_reset(connector, &asyc->state);
+ asyc->dither.mode = DITHERING_MODE_AUTO;
+ asyc->dither.depth = DITHERING_DEPTH_AUTO;
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index 64b220e017..e3a5f6f554 100644
--- a/series.conf
+++ b/series.conf
@@ -23181,6 +23181,7 @@
patches.fixes/crypto-ccp-gcm-use-const-time-tag-comparison.patch
patches.fixes/crypto-ccp-Fix-SEV_VERSION_GREATER_OR_EQUAL.patch
patches.drm/drm-nouveau-i2c-Enable-i2c-pads-busses-during-preini.patch
+ patches.drm/drm-nouveau-fix-memory-leak-in-nouveau_conn_reset.patch
patches.drivers/firmware-ti_sci-Always-request-response-from-firmwar.patch
patches.arch/kvm-svm-fix-detection-of-amd-errata-1096
patches.drivers/Input-synaptics-whitelist-Lenovo-T580-SMBus-intertou.patch