From: Cristian Ciocaltea Date: Mon, 9 Mar 2026 22:44:36 +0000 (+0200) Subject: drm/bridge: synopsys: dw-dp: Drop useless memory allocation X-Git-Tag: v7.2-rc1~141^2~26^2~202 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=971a6d5d41315f3bfe1e1207f24da9a191c949ff;p=thirdparty%2Fkernel%2Flinux.git drm/bridge: synopsys: dw-dp: Drop useless memory allocation The bridge gets allocated and initialized implicitly via the devm_drm_bridge_alloc() helper in dw_dp_bind(). However, this is preceded by an explicit allocation for the same dw_dp struct, which is never used anywhere as the return from devm_kzalloc() gets immediately overwritten by the aforementioned helper. Get rid of the unnecessary and confusing memory allocation. Signed-off-by: Cristian Ciocaltea Signed-off-by: Heiko Stuebner Link: https://patch.msgid.link/20260310-drm-rk-fixes-v2-8-645ecfb43f49@collabora.com --- diff --git a/drivers/gpu/drm/bridge/synopsys/dw-dp.c b/drivers/gpu/drm/bridge/synopsys/dw-dp.c index 45b37885d719d..3f4530c117c73 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-dp.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-dp.c @@ -1970,10 +1970,6 @@ struct dw_dp *dw_dp_bind(struct device *dev, struct drm_encoder *encoder, void __iomem *res; int ret; - dp = devm_kzalloc(dev, sizeof(*dp), GFP_KERNEL); - if (!dp) - return ERR_PTR(-ENOMEM); - dp = devm_drm_bridge_alloc(dev, struct dw_dp, bridge, &dw_dp_bridge_funcs); if (IS_ERR(dp)) return ERR_CAST(dp);