blob: 92f4dd84a51c98f880f402c2d890eec36dce2363 [file] [log] [blame]
From 30c50b351a46b73e4ce475b54b6072652180cc73 Mon Sep 17 00:00:00 2001
From: Chen Tao <chentao107@huawei.com>
Date: Mon, 8 Jun 2020 09:48:59 +0800
Subject: [PATCH] drm/msm/dpu: fix error return code in dpu_encoder_init
commit aa472721c8dbe1713cf510f56ffbc56ae9e14247 upstream.
Fix to return negative error code -ENOMEM with the use of
ERR_PTR from dpu_encoder_init.
Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support")
Signed-off-by: Chen Tao <chentao107@huawei.com>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index c62f7abcf509..e26d2f3363ee 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -2268,7 +2268,7 @@ struct drm_encoder *dpu_encoder_init(struct drm_device *dev,
dpu_enc = devm_kzalloc(dev->dev, sizeof(*dpu_enc), GFP_KERNEL);
if (!dpu_enc)
- return ERR_PTR(ENOMEM);
+ return ERR_PTR(-ENOMEM);
rc = drm_encoder_init(dev, &dpu_enc->base, &dpu_encoder_funcs,
drm_enc_mode, NULL);
--
2.27.0