drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
If the mipi_dsi_dual() macro fails, the error code is stored in
dsi_ctx.accum_err. Propagate that error back to the caller instead
of returning success as the current code does.
Fixes: a6adf47d30cc ("drm/panel: jdi-lpm102a188a: Fix bug and clean up driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c b/drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c
index 83656bb4b0b2..23462065d726 100644
--- a/drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c
+++ b/drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c
@@ -233,8 +233,10 @@ static int jdi_panel_prepare(struct drm_panel *panel)
mipi_dsi_dual(mipi_dsi_dcs_set_display_on_multi,
&dsi_ctx, jdi->link1, jdi->link2);
- if (dsi_ctx.accum_err < 0)
+ if (dsi_ctx.accum_err < 0) {
+ err = dsi_ctx.accum_err;
goto poweroff;
+ }
jdi->link1->mode_flags &= ~MIPI_DSI_MODE_LPM;
jdi->link2->mode_flags &= ~MIPI_DSI_MODE_LPM;
--
2.47.2
On Thu Aug 21, 2025 at 6:30 AM MDT, Dan Carpenter wrote: > If the mipi_dsi_dual() macro fails, the error code is stored in > dsi_ctx.accum_err. Propagate that error back to the caller instead > of returning success as the current code does. > > Fixes: a6adf47d30cc ("drm/panel: jdi-lpm102a188a: Fix bug and clean up driver") > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> > --- > drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) Good catch, Dan! Thank you for the patch. I'll try to be mindful of this kind of logic error in the future. Please let me know if you have other suggestions. Reviewed-by: Brigham Campbell <me@brighamcampbell.com> Regards, Brigham
On Sun, Aug 24, 2025 at 12:54:41PM -0600, Brigham Campbell wrote: > On Thu Aug 21, 2025 at 6:30 AM MDT, Dan Carpenter wrote: > > If the mipi_dsi_dual() macro fails, the error code is stored in > > dsi_ctx.accum_err. Propagate that error back to the caller instead > > of returning success as the current code does. > > > > Fixes: a6adf47d30cc ("drm/panel: jdi-lpm102a188a: Fix bug and clean up driver") > > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> > > --- > > drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > Good catch, Dan! Thank you for the patch. I'll try to be mindful of this > kind of logic error in the future. Please let me know if you have other > suggestions. > Heh. This is just static checker stuff. https://github.com/error27/smatch Humans are expected to have mechanical attention to detail at the same level as a computer. I just try to write the commit message out to prove that I've looked at the code as well. regards, dan carpenter
On Sun Aug 24, 2025 at 11:50 PM MDT, Dan Carpenter wrote: > On Sun, Aug 24, 2025 at 12:54:41PM -0600, Brigham Campbell wrote: >> Good catch, Dan! Thank you for the patch. I'll try to be mindful of this >> kind of logic error in the future. Please let me know if you have other >> suggestions. > > Heh. This is just static checker stuff. https://github.com/error27/smatch > Humans are expected to have mechanical attention to detail at the > same level as a computer. I just try to write the commit message out to > prove that I've looked at the code as well. Good to know! I'll consider integrating smatch and other static checking into my preflight checks. By the way, I'm interested in contributing more to drm as a hobbyist. I've been working on todo items in drm documentation and I plan to continue doing that. If there's anything you'd like help with or you know of any work to be done which I may not find in the todo list, please let me know. I can be contacted here on the public mailing lists, via direct email, or via #dri-devel on OFTC (my nick is xeyler). Cheers, Brigham
Hi, On Thu, Aug 21, 2025 at 5:31 AM Dan Carpenter <dan.carpenter@linaro.org> wrote: > > If the mipi_dsi_dual() macro fails, the error code is stored in > dsi_ctx.accum_err. Propagate that error back to the caller instead > of returning success as the current code does. > > Fixes: a6adf47d30cc ("drm/panel: jdi-lpm102a188a: Fix bug and clean up driver") > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> > --- > drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) Thanks for the fix. Reviewed-by: Douglas Anderson <dianders@chromium.org> Since it's straightforward and a fix, I'm not waiting and I'm pushing to drm-misc-next. [1/1] drm/panel: jdi-lpm102a188a: Fix error code in jdi_panel_prepare() commit: 61ce50fd8196c8782b9620bb60d33649ec429f64
© 2016 - 2025 Red Hat, Inc.