mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wang Jun <1742789905@qq.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Wang Jun <1742789905@qq.com>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: gszhai@bjtu.edu.cn, 25125332@bjtu.edu.cn, 25125283@bjtu.edu.cn,
	23120469@bjtu.edu.cn
Subject: [PATCH v7 0/1] media: saa7164: add ioremap return checks and cleanups
Date: Mon, 16 Mar 2026 20:24:00 +0800	[thread overview]
Message-ID: <tencent_8C4BA706AAC29A1F8EEE434963090403B905@qq.com> (raw)
In-Reply-To: <a44adff7-60fd-4fca-85f4-0c69a035ec69@web.de>

Hi Markus,

This v4 addressed all your comments:
- Added `Cc: stable@vger.kernel.org` to 
ensure the fix reaches stable kernels.
- Refactored the duplicate ioremap error handling into a helper function 
to improve code clarity and reduce duplication.
- Replaced manual mutex lock/unlock with `scoped_guard()` for better 
safety and readability.

After submitting v4 (which became v5 in the patchwork series due to 
a version bump), the Media CI robot detected two issues:
- Build errors caused by incorrect struct member names 
(`immio` → `lmmio`, `pci_dev` → `pci`).
- Two checkpatch `CHECK` warnings about alignment of function call
 arguments (open parenthesis alignment).

This v6 fixes those issues:
- Corrected the member names to match the actual struct definitions.
- Adjusted the code alignment in the `release_resources()` helper to
 satisfy `checkpatch.pl --strict`.

This v7 addresses two additional issues that were identified 
in the v6 submission:
Corrected a remaining instance where dev->lmmio was used 
instead of the correct dev->lmmio2 in the foo_bar() function.

Regarding the `Fixes` tag: I've added a tag pointing to the 
commit that originally introduced the driver. 
At that time, the file
was located at drivers/media/video/saa7164/saa7164-core.c; the `Fixes` tag
correctly identifies the commit where the issue first appeared, regardless
of the later file move.

The patch adds missing error checks for two ioremap calls in
saa7164_dev_setup(). If either mapping fails, the function now properly
releases previously allocated PCI resources, removes the device from the
global list, and returns -ENODEV. This prevents potential null pointer
dereferences and ensures proper cleanup on failure.

Please review the updated patch. Thanks!

Wang Jun (1):
  media: saa7164: add ioremap return checks and cleanups

 drivers/media/pci/saa7164/saa7164-core.c | 47 ++++++++++++++++++------
 1 file changed, 35 insertions(+), 12 deletions(-)

-- 
2.43.0


  parent reply	other threads:[~2026-03-16 12:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-12 13:32 [PATCH v3] media: saa7164: add missing ioremap error handling Wang Jun
2026-03-12 15:28 ` Markus Elfring
2026-03-13  8:08   ` [PATCH v4 0/1] media: saa7164: add ioremap return checks and cleanups Wang Jun
     [not found]   ` <20260313080845.169663-1-1742789905@qq.com>
2026-03-13  8:08     ` [PATCH v4] " Wang Jun
2026-03-16  0:48   ` [PATCH v5 0/1] " Wang Jun
     [not found]   ` <20260316004854.1711-1-1742789905@qq.com>
2026-03-16  0:48     ` [PATCH v5 1/1] " Wang Jun
2026-03-16  6:09   ` [PATCH v5 0/1] " Wang Jun
     [not found]   ` <20260316060940.9659-1-1742789905@qq.com>
2026-03-16  6:09     ` [PATCH v5] " Wang Jun
2026-03-16  9:16   ` [PATCH v6 0/1] " Wang Jun
     [not found]   ` <20260316091649.14827-1-1742789905@qq.com>
2026-03-16  9:16     ` [PATCH v6 1/1] " Wang Jun
2026-03-16 12:24   ` Wang Jun [this message]
     [not found]   ` <20260316122403.23337-1-1742789905@qq.com>
2026-03-16 12:24     ` [PATCH v7 " Wang Jun

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=tencent_8C4BA706AAC29A1F8EEE434963090403B905@qq.com \
    --to=1742789905@qq.com \
    --cc=23120469@bjtu.edu.cn \
    --cc=25125283@bjtu.edu.cn \
    --cc=25125332@bjtu.edu.cn \
    --cc=gszhai@bjtu.edu.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /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

all inboxes | Powered by JetHome®