mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-22 07:27:12 +08:00
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: dbdea37add ("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
This commit is contained in:
@@ -147,8 +147,8 @@ static int ws_bridge_probe(struct i2c_client *i2c)
|
||||
int ret;
|
||||
|
||||
ws = devm_drm_bridge_alloc(dev, struct ws_bridge, bridge, &ws_bridge_bridge_funcs);
|
||||
if (!ws)
|
||||
return -ENOMEM;
|
||||
if (IS_ERR(ws))
|
||||
return PTR_ERR(ws);
|
||||
|
||||
ws->dev = dev;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user