Skip to contentSkip to conversation

Free pRADEONEnt memory in RADEONFreeRec

PATCH In review Michel Dänzer 2 participants 5 messages Oct 20, 2017 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 Free pRADEONEnt memory in RADEONFreeRec

From: Michel Dänzer <[email protected]>

We were leaking it.

(Inspired by amdgpu commit 9d84934309e4ccd9a43c73d958b8ff10ef2fc990)

---
 src/radeon_kms.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
src/radeon_kms.c +2 -1
index 9ef51693a..df438768c 100644
@@ -218,7 +218,8 @@ static void RADEONFreeRec(ScrnInfoPtr pScrn)
                     pRADEONEnt->platform_dev->flags & XF86_PDEV_SERVER_FD))
 #endif
                 drmClose(pRADEONEnt->fd);
-            pRADEONEnt->fd = 0;
+            free(pPriv->ptr);
+            pPriv->ptr = NULL;
         }
     }
 
Signature · 6 lines
2.14.2

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20171020152820.14545-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org

#2 lore raw

PATCH 2/4 Free memory returned by xf86GetEntityInfo

From: Michel Dänzer <[email protected]>

We were leaking it.

(Ported from amdgpu commit cfccf4c4e7e5c73fe4040fabeb1b43283cf29b33)

---
 src/radeon_kms.c | 1 +
 1 file changed, 1 insertion(+)
src/radeon_kms.c +1 -0
index df438768c..f79af3415 100644
@@ -228,6 +228,7 @@ static void RADEONFreeRec(ScrnInfoPtr pScrn)
 	info->accel_state = NULL;
     }
 
+    free(info->pEnt);
     free(pScrn->driverPrivate);
     pScrn->driverPrivate = NULL;
 }
Signature · 6 lines
2.14.2

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#3 lore raw

PATCH 3/4 Call TimerFree for timer created in LeaveVT

In reply to a message not in the archive

From: Michel Dänzer <[email protected]>

We were leaking the memory allocated by TimerSet.

(Ported from amdgpu commit 84aad09f18fed6b52b0c073f0bbd675a6de07807)

---
 src/radeon_kms.c | 1 +
 1 file changed, 1 insertion(+)
src/radeon_kms.c +1 -0
index f79af3415..06c8a47fb 100644
@@ -2484,6 +2484,7 @@ CARD32 cleanup_black_fb(OsTimerPtr timer, CARD32 now, pointer data)
 	drmmode_fb_reference(pRADEONEnt->fd, &drmmode_crtc->fb, NULL);
     }
 
+    TimerFree(timer);
     return 0;
 }
 
Signature · 6 lines
2.14.2

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#4 lore raw

PATCH 4/4 Always call drmModeFreeProperty after drmModeGetProperty

In reply to a message not in the archive

From: Michel Dänzer <[email protected]>

We were not doing so in all cases, leaking memory allocated by the latter.

(Cherry picked from amdgpu commit f6b39bcd45cb06976ba8a3600df77fc471c63995)

---
 src/drmmode_display.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
src/drmmode_display.c +2 -2
index 369c1efc3..167ecfb43 100644
@@ -1913,8 +1913,8 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r
 				drmModeFreeProperty(props);
 				break;
 			}
-			drmModeFreeProperty(props);
 		}
+		drmModeFreeProperty(props);
 	}
 
 	kencoders = calloc(sizeof(drmModeEncoderPtr), koutput->count_encoders);
@@ -2003,8 +2003,8 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r
 				drmModeFreeProperty(props);
 				break;
 			}
-			drmModeFreeProperty(props);
 		}
+		drmModeFreeProperty(props);
 	}
 
 	if (dynamic) {
Signature · 6 lines
2.14.2

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20171020152820.14545-4-michel-otUistvHUpPR7s880joybQ@public.gmane.org

Reviewed-by Alex Deucher
#6 lore raw

RE: [PATCH xf86-video-ati 4/4] Always call drmModeFreeProperty after drmModeGetProperty

Quoted 10 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Michel Dänzer
Sent: Friday, October 20, 2017 11:28 AM
To: [email protected]
Subject: [PATCH xf86-video-ati 4/4] Always call drmModeFreeProperty after drmModeGetProperty

From: Michel Dänzer <[email protected]>

Quoted 7 lines

We were not doing so in all cases, leaking memory allocated by the latter.

(Cherry picked from amdgpu commit
f6b39bcd45cb06976ba8a3600df77fc471c63995)

Series is:

Quoted 34 lines
---
 src/drmmode_display.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
src/drmmode_display.c +0 -0
index 369c1efc3..167ecfb43 100644
@@ -1913,8 +1913,8 @@ drmmode_output_init(ScrnInfoPtr pScrn,

drmmode_ptr drmmode, drmModeResPtr mode_r

src/drmmode_display.c +1 -1
 				drmModeFreeProperty(props);
 				break;
 			}
-			drmModeFreeProperty(props);
 		}
+		drmModeFreeProperty(props);
 	}
 
 	kencoders = calloc(sizeof(drmModeEncoderPtr), koutput-
Quoted 1 line

count_encoders);

src/drmmode_display.c +0 -0
@@ -2003,8 +2003,8 @@ drmmode_output_init(ScrnInfoPtr pScrn,

drmmode_ptr drmmode, drmModeResPtr mode_r

src/drmmode_display.c +1 -2
 				drmModeFreeProperty(props);
 				break;
 			}
-			drmModeFreeProperty(props);
 		}
+		drmModeFreeProperty(props);
 	}
 
 	if (dynamic) {
--

2.14.2

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx