Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a07563f authored by Jayant Shekhar's avatar Jayant Shekhar Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/sde: fix blob memory leak during mode set



During mode set, new blobs are created but previous
blobs are not copied into the connector. Hence on
every set blob data, previous blobs are not freed
resulting in leak. Fix to update the connector
blob info structure with previous blob.

Change-Id: Ib168e7e3148d23f6cdbf7e1cec2b17d2e139a07d
Signed-off-by: default avatarJayant Shekhar <jshekhar@codeaurora.org>
parent 1e80fb1d
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -1767,7 +1767,7 @@ int sde_connector_set_blob_data(struct drm_connector *conn,
	struct sde_connector *c_conn = NULL;
	struct sde_connector_state *sde_conn_state = NULL;
	struct msm_mode_info mode_info;
	struct drm_property_blob *blob = NULL;
	struct drm_property_blob **blob = NULL;
	int rc = 0;

	c_conn = to_sde_connector(conn);
@@ -1811,7 +1811,7 @@ int sde_connector_set_blob_data(struct drm_connector *conn,
			}
		}

		blob = c_conn->blob_caps;
		blob = &c_conn->blob_caps;
	break;
	case CONNECTOR_PROP_MODE_INFO:
		rc = sde_connector_populate_mode_info(conn, info);
@@ -1821,7 +1821,7 @@ int sde_connector_set_blob_data(struct drm_connector *conn,
					rc);
			goto exit;
		}
		blob = c_conn->blob_mode_info;
		blob = &c_conn->blob_mode_info;
	break;
	default:
		SDE_ERROR_CONN(c_conn, "invalid prop_id: %d\n", prop_id);
@@ -1829,7 +1829,7 @@ int sde_connector_set_blob_data(struct drm_connector *conn,
	};

	msm_property_set_blob(&c_conn->property_info,
			&blob,
			blob,
			SDE_KMS_INFO_DATA(info),
			SDE_KMS_INFO_DATALEN(info),
			prop_id);