Skip to contentSkip to conversation

drm/amdgpu: fix warning in dce_virtual.c

PATCH In review Alex Deucher 2 participants 2 messages Oct 14, 2016 – Oct 15, 2016 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: fix warning in dce_virtual.c

copy paste typo when I re-arranged the code.

---
 drivers/gpu/drm/amd/amdgpu/dce_virtual.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/dce_virtual.c +4 -4
index 2eefa5d..48973b7 100644
@@ -657,18 +657,18 @@ static int dce_virtual_connector_encoder_init(struct amdgpu_device *adev,
 
 	/* add a new encoder */
 	encoder = kzalloc(sizeof(struct drm_encoder), GFP_KERNEL);
-	if (!encoder) {
-		kfree(connector);
+	if (!encoder)
 		return -ENOMEM;
-	}
 	encoder->possible_crtcs = 1 << index;
 	drm_encoder_init(adev->ddev, encoder, &dce_virtual_encoder_funcs,
 			 DRM_MODE_ENCODER_VIRTUAL, NULL);
 	drm_encoder_helper_add(encoder, &dce_virtual_encoder_helper_funcs);
 
 	connector = kzalloc(sizeof(struct drm_connector), GFP_KERNEL);
-	if (!connector)
+	if (!connector) {
+		kfree(encoder);
 		return -ENOMEM;
+	}
 
 	/* add a new connector */
 	drm_connector_init(adev->ddev, connector, &dce_virtual_connector_funcs,
Signature · 6 lines
2.5.5

_______________________________________________
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): 1476468027-10305-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#2 lore raw

if possible can you squash it into the original bad commit?

Quoted 25 lines · Alex Deucher

copy paste typo when I re-arranged the code.

---
 drivers/gpu/drm/amd/amdgpu/dce_virtual.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/dce_virtual.c +1 -3
index 2eefa5d..48973b7 100644
@@ -657,18 +657,18 @@ static int dce_virtual_connector_encoder_init(struct amdgpu_device *adev,
 
 	/* add a new encoder */
 	encoder = kzalloc(sizeof(struct drm_encoder), GFP_KERNEL);
-	if (!encoder) {
-		kfree(connector);
+	if (!encoder)
 		return -ENOMEM;
-	}
 	encoder->possible_crtcs = 1 << index;
 	drm_encoder_init(adev->ddev, encoder, &dce_virtual_encoder_funcs,
 			 DRM_MODE_ENCODER_VIRTUAL, NULL);
 	drm_encoder_helper_add(encoder, &dce_virtual_encoder_helper_funcs);

drivers/gpu/drm/amd/amdgpu/dce_virtual.c static int dce_virtual_connector_encoder_init(struct amdgpu_device *adev, · line 674

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/dce_virtual.c +3 -1
 
 	connector = kzalloc(sizeof(struct drm_connector), GFP_KERNEL);
-	if (!connector)
+	if (!connector) {
+		kfree(encoder);
 		return -ENOMEM;
+	}
 
 	/* add a new connector */
 	drm_connector_init(adev->ddev, connector, &dce_virtual_connector_funcs,

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