Skip to content

Commit 3e6339a

Browse files
author
Liu Ying
committed
drm/bridge: waveshare-dsi: Fix bailout for devm_drm_bridge_alloc()
devm_drm_bridge_alloc() returns ERR_PTR on failure instead of a NULL pointer, so use IS_ERR() to check the returned pointer and turn proper error code on failure by using PTR_ERR(). Fixes: dbdea37 ("drm: bridge: Add waveshare DSI2DPI unit driver") Signed-off-by: Liu Ying <victor.liu@nxp.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Link: https://lore.kernel.org/r/20250806084121.510207-1-victor.liu@nxp.com
1 parent 0265d0e commit 3e6339a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/gpu/drm/bridge/waveshare-dsi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ static int ws_bridge_probe(struct i2c_client *i2c)
147147
int ret;
148148

149149
ws = devm_drm_bridge_alloc(dev, struct ws_bridge, bridge, &ws_bridge_bridge_funcs);
150-
if (!ws)
151-
return -ENOMEM;
150+
if (IS_ERR(ws))
151+
return PTR_ERR(ws);
152152

153153
ws->dev = dev;
154154

0 commit comments

Comments
 (0)