mirror of
https://github.com/torvalds/linux.git
synced 2026-10-08 11:36:02 +02:00
The DisplayPort AUX channel gets initialized and registered during
dw_dp_bind(), but it is never unregistered, which may lead to resource
leaks and/or use-after-free.
Add the missing dw_dp_unbind() function to allow the users of the
library to handle the required cleanup, i.e. unregister the AUX adapter.
Fixes: 86eecc3a9c ("drm/bridge: synopsys: Add DW DPTX Controller support library")
Reviewed-by: Andy Yan <andy.yan@rock-chips.com>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patch.msgid.link/20260601-drm-rk-fixes-v4-1-c3f3f123e1da@collabora.com
29 lines
532 B
C
29 lines
532 B
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/*
|
|
* Copyright (c) 2025 Rockchip Electronics Co., Ltd.
|
|
*/
|
|
|
|
#ifndef __DW_DP__
|
|
#define __DW_DP__
|
|
|
|
#include <linux/device.h>
|
|
|
|
struct drm_encoder;
|
|
struct dw_dp;
|
|
|
|
enum {
|
|
DW_DP_MP_SINGLE_PIXEL,
|
|
DW_DP_MP_DUAL_PIXEL,
|
|
DW_DP_MP_QUAD_PIXEL,
|
|
};
|
|
|
|
struct dw_dp_plat_data {
|
|
u32 max_link_rate;
|
|
u8 pixel_mode;
|
|
};
|
|
|
|
struct dw_dp *dw_dp_bind(struct device *dev, struct drm_encoder *encoder,
|
|
const struct dw_dp_plat_data *plat_data);
|
|
void dw_dp_unbind(struct dw_dp *dp);
|
|
#endif /* __DW_DP__ */
|