Skip to contentSkip to conversation

drm/amd/display: Use kvfree() to free coeff in build_regamma()

PATCH Applied Denis Efremov 2 participants 3 messages Jun 5, 2020 – Jun 8, 2020

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

PATCH 1/2 drm/amd/display: Use kvfree() to free coeff in build_regamma()

Use kvfree() instead of kfree() to free coeff in build_regamma() because the memory is allocated with kvzalloc().

Fixes e752058b8671 ("drm/amd/display: Optimize gamma calculations")
---
 drivers/gpu/drm/amd/display/modules/color/color_gamma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/modules/color/color_gamma.c +1 -1
index 9431b48aecb4..56bb1f9f77ce 100644
@@ -843,7 +843,7 @@ static bool build_regamma(struct pwl_float_data_ex *rgb_regamma,
 	pow_buffer_ptr = -1; // reset back to no optimize
 	ret = true;
 release:
-	kfree(coeff);
+	kvfree(coeff);
 	return ret;
 }
 
Signature · 1 line
2.26.2
#1 lore raw

PATCH 2/2 drm/amd/display: Use kfree() to free rgb_user in calculate_user_regamma_ramp()

Use kfree() instead of kvfree() to free rgb_user in calculate_user_regamma_ramp() because the memory is allocated with kcalloc().

---
Looks like this kvfree is from merge conflict between 1fafef9dfe12 ("Merge drm-fixes-for-v4.17-rc6-urgent into drm-next") and 6396bb221514 ("treewide: kzalloc() -> kcalloc()"). I'm not adding cc to stable because the bug looks harmless. You can squash the commits if you want.

 drivers/gpu/drm/amd/display/modules/color/color_gamma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/modules/color/color_gamma.c +1 -1
index 56bb1f9f77ce..bcfe34ef8c28 100644
@@ -1777,7 +1777,7 @@ bool calculate_user_regamma_ramp(struct dc_transfer_func *output_tf,
 
 	kfree(rgb_regamma);
 rgb_regamma_alloc_fail:
-	kvfree(rgb_user);
+	kfree(rgb_user);
 rgb_user_alloc_fail:
 	return ret;
 }
Signature · 1 line
2.26.2
Applied
#2 lore raw
In reply to Denis Efremov
Quoted 7 lines · Denis Efremov

Use kvfree() instead of kfree() to free coeff in build_regamma() because the memory is allocated with kvzalloc().

Fixes e752058b8671 ("drm/amd/display: Optimize gamma calculations")

Applied the series. Thanks!

Alex

Quoted 24 lines
---
 drivers/gpu/drm/amd/display/modules/color/color_gamma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/modules/color/color_gamma.c +1 -2
index 9431b48aecb4..56bb1f9f77ce 100644
@@ -843,7 +843,7 @@ static bool build_regamma(struct pwl_float_data_ex *rgb_regamma,
        pow_buffer_ptr = -1; // reset back to no optimize
        ret = true;
 release:
-       kfree(coeff);
+       kvfree(coeff);
        return ret;
 }
 
--

2.26.2

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