public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: fbdev: wmt_ge_rops: use devm_platform_ioremap_resource()
Date: Thu, 05 Mar 2026 13:20:54 +1000	[thread overview]
Message-ID: <review-patch1-20260304-master-v1-1-2bfeb1b9559f@gmail.com> (raw)
In-Reply-To: <20260304-master-v1-1-2bfeb1b9559f@gmail.com>

Patch Review

**Bug: `regbase` left as ERR_PTR on probe failure**

When `devm_platform_ioremap_resource()` fails, it returns an ERR_PTR value which gets assigned to `regbase`. The function then returns the error code, but `regbase` is left holding a non-NULL error-pointer value. On a subsequent probe attempt (or re-probe), the single-instance guard at line 152:

```c
if (unlikely(regbase)) {
    WARN_ON(1);
    return -EBUSY;
}
```

will see the stale ERR_PTR as non-NULL, fire the WARN_ON, and return `-EBUSY` — permanently blocking the driver from ever probing successfully again.

Fix: reset `regbase` to NULL in the error path:

```c
regbase = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(regbase)) {
    int ret = PTR_ERR(regbase);
    regbase = NULL;
    return ret;
}
```

**Removal of `iounmap()` is correct** — `devm_platform_ioremap_resource()` registers a devres action that automatically unmaps on device removal, so the explicit `iounmap()` must go. Setting `regbase = NULL` in `remove()` is the right thing to do for the re-probe guard.

**Minor: no `dev_err` on failure** — The original code printed `"failed to map I/O memory"` on failure. `devm_platform_ioremap_resource()` does emit its own error messages internally, so dropping the explicit `dev_err` is fine.

**Overall:** The patch needs a v2 to fix the ERR_PTR-in-`regbase` issue on the error path. Otherwise the conversion is clean and correct.

---
Generated by Claude Code Patch Reviewer

      parent reply	other threads:[~2026-03-05  3:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-04 17:10 [PATCH] fbdev: wmt_ge_rops: use devm_platform_ioremap_resource() Amin GATTOUT
2026-03-05  3:20 ` Claude review: " Claude Code Review Bot
2026-03-05  3:20 ` Claude Code Review Bot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=review-patch1-20260304-master-v1-1-2bfeb1b9559f@gmail.com \
    --to=claude-review@example.com \
    --cc=dri-devel-reviews@example.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox