[PATCH] drm: Fix two memleaks.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Jianpeng Ma <majianpeng@xxxxxxxxx>
---
 drivers/gpu/drm/drm_edid.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index c194f4e..05aa33a 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1081,6 +1081,7 @@ drm_do_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter)
     new = krealloc(block, (block[0x7e] + 1) * EDID_LENGTH, GFP_KERNEL);
     if (!new)
         goto out;
+    kfree(block);
     block = new;
 
     for (j = 1; j <= block[0x7e]; j++) {
@@ -1110,6 +1111,7 @@ drm_do_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter)
         new = krealloc(block, (valid_extensions + 1) * EDID_LENGTH, GFP_KERNEL);
         if (!new)
             goto out;
+        kfree(block);
         block = new;
     }
 
-- 
1.8.2.rc2.4.g7799588

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux